Skip to content

Commit

Permalink
ci: configure monorepo sonarcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Nov 22, 2022
1 parent 2739f83 commit 706b073
Show file tree
Hide file tree
Showing 43 changed files with 734 additions and 327 deletions.
44 changes: 0 additions & 44 deletions .build.sh

This file was deleted.

62 changes: 0 additions & 62 deletions .codecov.yml

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,5 @@ jobs:
run: GOARCH=${{ matrix.go-arch }} LEDGER_ENABLED=false make build
- name: Build Legacy
run: GOARCH=${{ matrix.go-arch }} LEDGER_ENABLED=false COSMOS_BUILD_OPTIONS=legacy make build

- name: Build Cosmovisor
run: GOARCH=${{ matrix.go-arch }} LEDGER_ENABLED=false make cosmovisor
17 changes: 1 addition & 16 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,14 @@ jobs:
build:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for technote-space/get-diff-action to get git reference
pull-requests: read
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip-sims')"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.2
- uses: technote-space/get-diff-action@v6.1.1
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- name: Get data from Go build cache
if: ${{ false }}
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
- run: make build
- name: Install runsim
run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/test-client-v2-skip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Tests Client V2
# This workflow allows to skip the test step if the PR does not contain any changes to the module
# See https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
on:
pull_request:
paths-ignore:
- "client/v2/**"

concurrency:
group: ci-${{ github.ref }}-tests-client-v2
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-latest
steps:
- run: 'echo "No tests required"'
36 changes: 36 additions & 0 deletions .github/workflows/test-client-v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Tests Client V2
on:
push:
branches:
- main
paths:
- "client/v2/**"
pull_request:
paths:
- "client/v2/**"

concurrency:
group: ci-${{ github.ref }}-tests-client-v2
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: 1.19.2
- name: tests
run: |
cd client/v2
go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
- name: sonarcloud
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_CLIENT_V2 }}
with:
projectBaseDir: client/v2/
17 changes: 17 additions & 0 deletions .github/workflows/test-core-skip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Tests Core
# This workflow allows to skip the test step if the PR does not contain any changes to the module
# See https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
on:
pull_request:
paths-ignore:
- "core/**"

concurrency:
group: ci-${{ github.ref }}-tests-core
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-latest
steps:
- run: 'echo "No tests required"'
36 changes: 36 additions & 0 deletions .github/workflows/test-core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Tests Core
on:
push:
branches:
- main
paths:
- "core/**"
pull_request:
paths:
- "core/**"

concurrency:
group: ci-${{ github.ref }}-tests-core
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: 1.19.2
- name: tests
run: |
cd core
go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
- name: sonarcloud
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_CORE }}
with:
projectBaseDir: core/
17 changes: 17 additions & 0 deletions .github/workflows/test-depinject-skip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Tests Depinject
# This workflow allows to skip the test step if the PR does not contain any changes to the module
# See https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
on:
pull_request:
paths-ignore:
- "depinject/**"

concurrency:
group: ci-${{ github.ref }}-tests-depinject
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-latest
steps:
- run: 'echo "No tests required"'
34 changes: 34 additions & 0 deletions .github/workflows/test-depinject.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Tests Depinject
on:
push:
branches:
- main
paths:
- "depinject/**"
pull_request:
paths:
- "depinject/**"

concurrency:
group: ci-${{ github.ref }}-tests-depinject
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: 1.19.2
- name: tests
run: |
cd depinject
go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
- name: sonarcloud
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_DEPINJECT }}
4 changes: 4 additions & 0 deletions .github/workflows/test-e2e-skip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
- "go.mod"
- "go.sum"

concurrency:
group: ci-${{ github.ref }}-tests-e2e
cancel-in-progress: true

jobs:
test-e2e:
runs-on: ubuntu-latest
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ on:
permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}-tests-e2e
cancel-in-progress: true

jobs:
test-e2e:
runs-on: ubuntu-latest
Expand All @@ -28,3 +32,10 @@ jobs:
- name: e2e tests
run: |
make test-e2e
- name: sonarcloud
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_TESTS }}
with:
projectBaseDir: tests/
17 changes: 17 additions & 0 deletions .github/workflows/test-errors-skip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Tests Errors
# This workflow allows to skip the test step if the PR does not contain any changes to the module
# See https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
on:
pull_request:
paths-ignore:
- "errors/**"

concurrency:
group: ci-${{ github.ref }}-tests-errors
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-latest
steps:
- run: 'echo "No tests required"'
34 changes: 34 additions & 0 deletions .github/workflows/test-errors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Tests Errors
on:
push:
branches:
- main
paths:
- "errors/**"
pull_request:
paths:
- "errors/**"

concurrency:
group: ci-${{ github.ref }}-tests-errors
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.2
- name: tests
run: |
cd tests
go test -mod=readonly -timeout 30m -coverprofile=errors-coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
- name: sonarcloud
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_ERRORS }}
with:
projectBaseDir: errors/
Loading

0 comments on commit 706b073

Please sign in to comment.