From 6c459782c06e4373b22aa2e7fa8b88b6b9e82141 Mon Sep 17 00:00:00 2001 From: Matt Bishop Date: Tue, 26 May 2026 13:28:56 -0400 Subject: [PATCH 1/2] ci: upload coverage to GitHub Actions code coverage preview Mirror the existing codecov.io upload to GitHub's new code coverage feature (public preview, announced 2026-05-26) so coverage shows up directly on pull requests. Merges per-project Cobertura files with dotnet-coverage before upload. --- .github/workflows/test-database.yml | 15 +++++++++++++++ .github/workflows/test.yml | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/.github/workflows/test-database.yml b/.github/workflows/test-database.yml index 1cb784bb9328..e4378b294fb4 100644 --- a/.github/workflows/test-database.yml +++ b/.github/workflows/test-database.yml @@ -42,6 +42,7 @@ jobs: contents: read actions: read checks: write + code-quality: write steps: - name: Check out repo uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -167,6 +168,20 @@ jobs: - name: Upload to codecov.io uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0 + - name: Merge coverage reports + if: ${{ !cancelled() }} + run: | + dotnet tool install --global dotnet-coverage + dotnet-coverage merge -f cobertura -o coverage.cobertura.xml "**/coverage.cobertura.xml" + + - name: Upload coverage to GitHub + if: ${{ !cancelled() }} + uses: actions/upload-code-coverage@b51da2c3c1b23e04d2d6477cfc34350b1f5cd3e9 # v1.2.0 + with: + file: coverage.cobertura.xml + language: C# + label: code-coverage/database + - name: Docker Compose down if: always() working-directory: "dev" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3da63ba734cf..57950d512ce3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,6 +19,7 @@ jobs: runs-on: ubuntu-22.04 permissions: checks: write + code-quality: write contents: read pull-requests: write @@ -66,3 +67,17 @@ jobs: - name: Upload to codecov.io uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0 + + - name: Merge coverage reports + if: ${{ !cancelled() }} + run: | + dotnet tool install --global dotnet-coverage + dotnet-coverage merge -f cobertura -o coverage.cobertura.xml "**/coverage.cobertura.xml" + + - name: Upload coverage to GitHub + if: ${{ !cancelled() }} + uses: actions/upload-code-coverage@b51da2c3c1b23e04d2d6477cfc34350b1f5cd3e9 # v1.2.0 + with: + file: coverage.cobertura.xml + language: C# + label: code-coverage/unit From c0749eaa8d92066137cf91fc1b3824b54fc0df0c Mon Sep 17 00:00:00 2001 From: Matt Bishop Date: Tue, 26 May 2026 15:47:42 -0400 Subject: [PATCH 2/2] ci: pin dotnet-coverage version --- .github/workflows/test-database.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-database.yml b/.github/workflows/test-database.yml index e4378b294fb4..10b2526e68ea 100644 --- a/.github/workflows/test-database.yml +++ b/.github/workflows/test-database.yml @@ -171,7 +171,7 @@ jobs: - name: Merge coverage reports if: ${{ !cancelled() }} run: | - dotnet tool install --global dotnet-coverage + dotnet tool install --global dotnet-coverage --version 18.7.0 dotnet-coverage merge -f cobertura -o coverage.cobertura.xml "**/coverage.cobertura.xml" - name: Upload coverage to GitHub diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 57950d512ce3..dc5439b99b58 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -71,7 +71,7 @@ jobs: - name: Merge coverage reports if: ${{ !cancelled() }} run: | - dotnet tool install --global dotnet-coverage + dotnet tool install --global dotnet-coverage --version 18.7.0 dotnet-coverage merge -f cobertura -o coverage.cobertura.xml "**/coverage.cobertura.xml" - name: Upload coverage to GitHub