From 98a6320cf722495a74978134ed388eb6712a1b95 Mon Sep 17 00:00:00 2001 From: Kevin Hahn Date: Thu, 6 Aug 2026 16:14:31 +0700 Subject: [PATCH] Collect code coverage in CI CI ran plain `dotnet test` with no coverage collection, so there was no coverage measurement despite coverlet.collector being referenced. Collect XPlat Code Coverage into a results directory and upload the cobertura report as a build artifact for visibility. Validated with actionlint. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/test.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e13030e..a0d30b8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -20,7 +20,17 @@ jobs: uses: actions/setup-dotnet@v4 - name: Build & test - run: dotnet test --configuration Release --logger GitHubActions + run: >- + dotnet test --configuration Release --logger GitHubActions + --collect:"XPlat Code Coverage" + --results-directory ${{ github.workspace }}/coverage + - name: Upload coverage report + if: ${{ !cancelled() }} + uses: actions/upload-artifact@v4 + with: + name: coverage + path: ${{ github.workspace }}/coverage/**/coverage.cobertura.xml + if-no-files-found: error - name: Download previous benchmark data uses: actions/cache@v4 with: