Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 40 additions & 3 deletions .github/workflows/go-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:

jobs:

coverage:
build-and-test:
name: "Go CI Tests Coverage"
strategy:
fail-fast: false
Expand Down Expand Up @@ -47,15 +47,52 @@ jobs:
- name: Coverage
run: go tool cover -func="coverage.out"

- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage.out

codecov:
name: Upload to Codecov
runs-on: ubuntu-24.04
needs: build-and-test

steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Download coverage artifact
uses: actions/download-artifact@v5
with:
name: coverage-report

- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v5
with:
files: coverage.out
token: ${{ secrets.CODECOV_TOKEN }} # required
verbose: true # optional (default = false)

- name: Analyze with SonarCloud
sonarqube:
name: Analyze with SonarQube
runs-on: ubuntu-24.04
needs: build-and-test

steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Download coverage artifact
uses: actions/download-artifact@v5
with:
name: coverage-report

- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# Needed to get PR information, if any
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}