Skip to content

ci: replace codecov with sonarcloud #1

ci: replace codecov with sonarcloud

ci: replace codecov with sonarcloud #1

Workflow file for this run

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 }}