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()