From fa9f550efe89c41e223fb901086ca22787c17d10 Mon Sep 17 00:00:00 2001 From: Alan Brault Date: Sat, 23 May 2026 09:25:07 -0400 Subject: [PATCH] fix: merge coverage reports for SonarCloud Signed-off-by: Alan Brault # Conflicts: # .github/workflows/ci.yml --- .github/workflows/ci.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 50ae5c9..da7d18d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,6 +56,10 @@ jobs: if: github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' run: dotnet tool update dotnet-sonarscanner --tool-path .sonar/scanner + - name: Install dotnet-coverage tool + if: github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' + run: dotnet tool update dotnet-coverage --global + - name: Begin SonarCloud analysis if: github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' run: | @@ -64,7 +68,7 @@ jobs: /o:"visus" \ /d:sonar.token="$SONAR_TOKEN" \ /d:sonar.host.url="https://sonarcloud.io" \ - /d:sonar.cs.vscoveragexml.reportsPaths="**/TestResults/**/coverage.xml" \ + /d:sonar.cs.vscoveragexml.reportsPaths="coverage.xml" \ /d:sonar.cs.vstest.reportsPaths="**/TestResults/**/*.trx" - name: Build @@ -72,11 +76,17 @@ jobs: - name: Run tests run: | - dotnet test -c Release --no-build --no-restore \ + dotnet test -c Release --no-build --no-restore -- \ --coverage \ - --coverage-output coverage.xml \ --coverage-output-format xml \ - -- --report-trx + --report-trx + + - name: Merge coverage reports + if: github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' + run: | + dotnet-coverage merge "tests/**/TestResults/*.xml" \ + --output coverage.xml \ + --output-format xml - name: Upload test results if: always()