diff --git a/.github/actions/report-coverage/action.yml b/.github/actions/report-coverage/action.yml index c84aa806d7e..58ccfb23bd0 100644 --- a/.github/actions/report-coverage/action.yml +++ b/.github/actions/report-coverage/action.yml @@ -8,6 +8,9 @@ inputs: integration-cov-path: description: 'Path to integration test coverage file' required: true + codecov-token: + description: 'Token for CodeCov' + required: true runs: using: "composite" @@ -43,4 +46,15 @@ runs: echo '# Coverage' >> $GITHUB_STEP_SUMMARY echo '```' >> $GITHUB_STEP_SUMMARY grep 'total:' backend-funcs.log | tr '\t' ' ' >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + + - name: Report coverage to CodeCov + uses: codecov/codecov-action@v5 + with: + files: backend.cov + flags: unified-backend + name: backend + slug: grafana/grafana + # This URL doesn't use the Google auth, but is much more locked down. As such, it requires OIDC or a CodeCov-provided token to do anything. + url: https://codecov-webhook.grafana-dev.net + token: ${{ inputs.codecov-token }} diff --git a/.github/workflows/pr-test-backend.yml b/.github/workflows/pr-test-backend.yml index 6246fe5837d..e86c20c387a 100644 --- a/.github/workflows/pr-test-backend.yml +++ b/.github/workflows/pr-test-backend.yml @@ -25,17 +25,17 @@ jobs: name: Test Backend runs-on: ubuntu-latest continue-on-error: true - + steps: - name: Checkout code uses: actions/checkout@v4 - + - name: Setup Go uses: actions/setup-go@v5 with: go-version: '1.23.7' cache: true - + - name: Install dependencies run: | sudo apt-get update @@ -61,7 +61,7 @@ jobs: run: | echo "Event: ${{ github.event_name }}" echo "Ref: ${{ github.ref }}" - + if [[ "${{ github.event_name }}" == "pull_request" ]]; then echo "PR changed files:" files=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files --jq '.[].filename') @@ -100,6 +100,7 @@ jobs: with: unit-cov-path: unit.cov integration-cov-path: integration.cov + codecov-token: ${{ secrets.CODECOV_TOKEN }} concurrency: group: ${{ github.workflow }}-${{ github.ref }}