ci: configure sonarcloud (#13921)

This commit is contained in:
Julien Robert
2022-11-18 15:14:49 +00:00
committed by GitHub
parent b425907b95
commit eb4afa74ba
36 changed files with 38 additions and 89 deletions
+6 -25
View File
@@ -119,11 +119,13 @@ jobs:
name: "${{ github.sha }}-${{ matrix.part }}-coverage"
path: ./${{ matrix.part }}profile.out
upload-coverage-report:
repo-analysis:
runs-on: ubuntu-latest
needs: tests
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: technote-space/get-diff-action@v6.1.1
with:
PATTERNS: |
@@ -154,35 +156,14 @@ jobs:
- run: |
cat ./*profile.out | grep -v "mode: atomic" >> coverage.txt
if: env.GIT_DIFF
- name: filter out DONTCOVER
run: |
excludelist="$(find ./ -type f -name '*.go' | xargs grep -l 'DONTCOVER')"
excludelist+=" $(find ./ -type f -name '*.pb.go')"
excludelist+=" $(find ./ -type f -name '*.pb.gw.go')"
excludelist+=" $(find ./ -type f -path './tests/mocks/*.go')"
for filename in ${excludelist}; do
filename=$(echo $filename | sed 's/^./github.com\/cosmos\/cosmos-sdk/g')
echo "Excluding ${filename} from coverage report..."
sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt
done
if: env.GIT_DIFF
- uses: codecov/codecov-action@v3
with:
file: ./coverage.txt
if: env.GIT_DIFF
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- uses: codecov/codecov-action@v3
with:
file: ./coverage.txt
test-rosetta:
runs-on: ubuntu-latest