From 28e6c838ab924d0cf4b4f41833e1334f224563fb Mon Sep 17 00:00:00 2001 From: Nick Ficano Date: Sun, 24 May 2026 21:20:48 -0400 Subject: [PATCH] ci: upload coverage to Codecov `dotnet test --collect:"XPlat Code Coverage"` (coverlet.collector) is already producing one coverage.cobertura.xml per test project under TestResults/. Upload the directory to Codecov non-blockingly so a Codecov outage cannot break CI. Requires CODECOV_TOKEN to be set as a repo secret. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/test.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 621691d..46e60b0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -88,6 +88,18 @@ jobs: run: | python3 scripts/check-coverage.py --threshold 80 --results-dir "${{ github.workspace }}/TestResults" + # `--collect:"XPlat Code Coverage"` (coverlet.collector) writes one + # coverage.cobertura.xml per test project under TestResults//. + # Non-blocking: a Codecov outage must not break CI. + - name: Upload coverage to Codecov + # codecov/codecov-action v6.0.1 + uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 + with: + fail_ci_if_error: false + flags: unittests + directory: ${{ github.workspace }}/TestResults + token: ${{ secrets.CODECOV_TOKEN }} + - name: Upload test results if: failure() uses: actions/upload-artifact@v7