-
Notifications
You must be signed in to change notification settings - Fork 616
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Carlos Rodriguez
committed
Mar 6, 2024
1 parent
511236b
commit bff0de0
Showing
15 changed files
with
195 additions
and
140 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
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
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,60 @@ | ||
|
||
name: Repo analysis | ||
# Tests / Code Coverage workflow runs unit tests and uploads a code coverage report | ||
# This workflow is run on pushes to main & every Pull Requests where a .go, .mod, .sum have been changed | ||
on: | ||
workflow_run: | ||
workflows: ["Tests / Code Coverage", "Tests / E2E", "Tests / E2E Wasm"] | ||
branches: [main] | ||
types: | ||
- completed | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
repo-analysis: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: technote-space/[email protected] | ||
id: git_diff | ||
with: | ||
PATTERNS: | | ||
**/*.go | ||
go.mod | ||
go.sum | ||
**/go.mod | ||
**/go.sum | ||
- uses: actions/download-artifact@v4 | ||
if: env.GIT_DIFF | ||
with: | ||
name: '${{ github.sha }}-00-coverage' | ||
- uses: actions/download-artifact@v4 | ||
if: env.GIT_DIFF | ||
with: | ||
name: '${{ github.sha }}-01-coverage' | ||
- uses: actions/download-artifact@v4 | ||
if: env.GIT_DIFF | ||
with: | ||
name: '${{ github.sha }}-02-coverage' | ||
- uses: actions/download-artifact@v4 | ||
if: env.GIT_DIFF | ||
with: | ||
name: '${{ github.sha }}-03-coverage' | ||
- uses: actions/download-artifact@v4 | ||
if: env.GIT_DIFF | ||
with: | ||
name: '${{ github.sha }}-e2e-coverage' | ||
continue-on-error: true | ||
- uses: actions/download-artifact@v4 | ||
if: env.GIT_DIFF | ||
with: | ||
name: '${{ github.sha }}-e2e-wasm-coverage' | ||
continue-on-error: true | ||
- 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 |
---|---|---|
|
@@ -104,53 +104,7 @@ 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: | ||
runs-on: ubuntu-latest | ||
needs: tests | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: technote-space/[email protected] | ||
with: | ||
PATTERNS: | | ||
**/**.go | ||
go.mod | ||
go.sum | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: '${{ github.sha }}-00-coverage' | ||
if: env.GIT_DIFF | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: '${{ github.sha }}-01-coverage' | ||
if: env.GIT_DIFF | ||
- uses: actions/download-artifact@v4 | ||
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 |
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
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=- |