Skip to content

Commit

Permalink
chore: separate code-analysis step from tests. Only run on non-fork P…
Browse files Browse the repository at this point in the history
…Rs. (cosmos#6077)

* chore: separate code-analysis step from tests. Only run on non-fork PRs.
  • Loading branch information
DimitrisJim authored Apr 2, 2024
1 parent 031c2b8 commit c92bf55
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/callbacks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,16 @@ jobs:
run: |
cd modules/apps/callbacks
go test -v -mod=readonly ./...
code-analysis:
if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- 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/
projectBaseDir: modules/apps/callbacks/
8 changes: 6 additions & 2 deletions .github/workflows/capability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
GOARCH=${{ matrix.go-arch }} go build ./...
tests:
if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -35,11 +34,16 @@ jobs:
run: |
cd modules/capability
go test -v -mod=readonly ./...
code-analysis:
if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- 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/
projectBaseDir: modules/capability/
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
name: '${{ github.sha }}-${{ matrix.part }}-coverage'
path: ./${{ matrix.part }}profile.out

repo-analysis:
code-analysis:
if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
needs: [tests]
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/wasm-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ jobs:
GOARCH=${{ matrix.go-arch }} CGO_ENABLED=1 go build ./...
tests:
if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -56,6 +55,11 @@ jobs:
run: |
cd modules/light-clients/08-wasm
go test -v -mod=readonly ./...
code-analysis:
if: github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- name: sonarcloud
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
uses: SonarSource/[email protected]
Expand Down

0 comments on commit c92bf55

Please sign in to comment.