diff --git a/.github/workflows/go-coverage.yml b/.github/workflows/go-coverage.yml index 2d86247..db28d16 100644 --- a/.github/workflows/go-coverage.yml +++ b/.github/workflows/go-coverage.yml @@ -15,7 +15,7 @@ env: jobs: - coverage: + build-and-test: name: "Go CI Tests Coverage" strategy: fail-fast: false @@ -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 }}