Skip to content

Commit fbe863f

Browse files
nficanoNick Ficanoclaude
authored
ci: collect + upload coverage to Codecov (#32)
Enable `--collect:"XPlat Code Coverage"` on the unit test run (coverlet.collector is already a dev dependency in both test projects) and upload the produced Cobertura XML(s) to Codecov non-blockingly. Requires CODECOV_TOKEN to be set as a repo secret. Co-authored-by: Nick Ficano <nficano@teachmehipaa.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5485c9a commit fbe863f

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

.github/workflows/test.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,29 @@ jobs:
7575
- name: Build
7676
run: dotnet build ARCP.slnx --configuration Release --no-restore
7777

78-
- name: Test (unit)
78+
- name: Test (unit, with coverage)
7979
run: >
8080
dotnet test tests/Arcp.UnitTests/Arcp.UnitTests.fsproj
8181
--configuration Release
8282
--no-build
8383
--verbosity normal
84+
--collect:"XPlat Code Coverage"
8485
--logger "trx;LogFileName=unit-tests.trx"
8586
--logger "console;verbosity=normal"
8687
--results-directory ${{ github.workspace }}/TestResults
8788
89+
# coverlet.collector writes one coverage.cobertura.xml per test
90+
# project under TestResults/<guid>/. Non-blocking so a Codecov
91+
# outage cannot break CI.
92+
- name: Upload coverage to Codecov
93+
# codecov/codecov-action v6.0.1
94+
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
95+
with:
96+
fail_ci_if_error: false
97+
flags: unittests
98+
directory: ${{ github.workspace }}/TestResults
99+
token: ${{ secrets.CODECOV_TOKEN }}
100+
88101
- name: Upload test results
89102
if: failure()
90103
uses: actions/upload-artifact@v7

0 commit comments

Comments
 (0)