-
Notifications
You must be signed in to change notification settings - Fork 620
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: replace codecov with sonarcloud (#5931)
* ci: replace codecov with sonarcloud * simplify for now repo analysis step by not considering coverage by e2e tests * Apply suggestions from code review Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Loading branch information
1 parent
3f7320c
commit 9095690
Showing
12 changed files
with
107 additions
and
87 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,3 +48,11 @@ jobs: | |
run: | | ||
cd modules/apps/callbacks | ||
go test -v -mod=readonly ./... | ||
- name: sonarcloud | ||
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} | ||
uses: SonarSource/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
with: | ||
projectBaseDir: modules/apps/callbacks/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,11 @@ jobs: | |
run: | | ||
cd modules/capability | ||
go test -v -mod=readonly ./... | ||
- name: sonarcloud | ||
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} | ||
uses: SonarSource/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
with: | ||
projectBaseDir: modules/capability/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,53 +104,44 @@ jobs: | |
cat pkgs.txt.part.${{ matrix.part }} | xargs go test -mod=readonly -timeout 30m -coverprofile=${{ matrix.part }}profile.out -covermode=atomic -tags='ledger test_ledger_mock' | ||
if: env.GIT_DIFF | ||
- uses: actions/upload-artifact@v4 | ||
if: env.GIT_DIFF | ||
with: | ||
name: '${{ github.sha }}-${{ matrix.part }}-coverage' | ||
path: ./${{ matrix.part }}profile.out | ||
|
||
upload-coverage-report: | ||
repo-analysis: | ||
runs-on: ubuntu-latest | ||
needs: tests | ||
needs: [tests] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: technote-space/[email protected] | ||
id: git_diff | ||
with: | ||
PATTERNS: | | ||
**/**.go | ||
**/*.go | ||
go.mod | ||
go.sum | ||
**/go.mod | ||
**/go.sum | ||
- uses: actions/download-artifact@v4 | ||
if: env.GIT_DIFF | ||
with: | ||
name: '${{ github.sha }}-00-coverage' | ||
if: env.GIT_DIFF | ||
- uses: actions/download-artifact@v4 | ||
if: env.GIT_DIFF | ||
with: | ||
name: '${{ github.sha }}-01-coverage' | ||
if: env.GIT_DIFF | ||
- uses: actions/download-artifact@v4 | ||
if: env.GIT_DIFF | ||
with: | ||
name: '${{ github.sha }}-02-coverage' | ||
if: env.GIT_DIFF | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: '${{ github.sha }}-03-coverage' | ||
if: env.GIT_DIFF | ||
- 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@v4 | ||
with: | ||
file: ./coverage.txt | ||
if: env.GIT_DIFF | ||
name: '${{ github.sha }}-03-coverage' | ||
- name: sonarcloud | ||
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }} | ||
uses: SonarSource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,3 +55,11 @@ jobs: | |
run: | | ||
cd modules/light-clients/08-wasm | ||
go test -v -mod=readonly ./... | ||
- name: sonarcloud | ||
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }} | ||
uses: SonarSource/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
with: | ||
projectBaseDir: modules/light-clients/08-wasm/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
sonar.projectKey=ibc-go-callbacks | ||
sonar.organization=cosmos | ||
|
||
sonar.projectName=ibc-go - Callbacks | ||
sonar.project.monorepo.enabled=true | ||
|
||
sonar.sources=. | ||
sonar.exclusions=**/*_test.go | ||
sonar.tests=. | ||
sonar.test.inclusions=**/*_test.go | ||
sonar.go.coverage.reportPaths=coverage.out | ||
|
||
sonar.sourceEncoding=UTF-8 | ||
sonar.scm.provider=git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
sonar.projectKey=ibc-go-capability | ||
sonar.organization=cosmos | ||
|
||
sonar.projectName=ibc-go - Capability | ||
sonar.project.monorepo.enabled=true | ||
|
||
sonar.sources=. | ||
sonar.exclusions=**/*_test.go | ||
sonar.tests=. | ||
sonar.test.inclusions=**/*_test.go | ||
sonar.go.coverage.reportPaths=coverage.out | ||
|
||
sonar.sourceEncoding=UTF-8 | ||
sonar.scm.provider=git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
sonar.projectKey=ibc-go-08-wasm | ||
sonar.organization=cosmos | ||
|
||
sonar.projectName=ibc-go - 08-wasm | ||
sonar.project.monorepo.enabled=true | ||
|
||
sonar.sources=. | ||
sonar.exclusions=**/*_test.go | ||
sonar.tests=. | ||
sonar.test.inclusions=**/*_test.go | ||
sonar.go.coverage.reportPaths=coverage.out | ||
|
||
sonar.sourceEncoding=UTF-8 | ||
sonar.scm.provider=git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
sonar-projects.propertiessonar.projectKey=cosmos_ibc-go | ||
sonar.organization=cosmos | ||
|
||
sonar.projectName=ibc-go | ||
sonar.project.monorepo.enabled=true | ||
|
||
sonar.sources=. | ||
sonar.exclusions=**/*_test.go,**/testing/**,e2e/**,**/*.pb.go,**/*.pb.gw.go,**/*.pulsar.go,docs/**,**/*.md,scripts/**, | ||
sonar.tests=. | ||
sonar.test.inclusions=**/*_test.go,**/testing/**,e2e/**,**/testutil/** | ||
sonar.go.coverage.reportPaths=coverage.out,*profile.out | ||
|
||
sonar.python.version=3 | ||
sonar.sourceEncoding=UTF-8 | ||
sonar.scm.provider=git | ||
|
||
# Exclude C/C++/Objective-C files from analysis | ||
sonar.c.file.suffixes=- | ||
sonar.cpp.file.suffixes=- | ||
sonar.objc.file.suffixes=- |