Skip to content

Commit 1525785

Browse files
committed
Add ReportGenerator for HTML coverage report generation and upload
1 parent be4974d commit 1525785

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

.github/workflows/ci-build-test.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,30 @@ jobs:
3232
- name: Run unit tests
3333
run: dotnet test tests/HubDocs.UnitTests/HubDocs.UnitTests.csproj -c Release --no-build --collect:"XPlat Code Coverage"
3434

35+
- name: Install ReportGenerator
36+
if: always()
37+
run: |
38+
dotnet tool install --global dotnet-reportgenerator-globaltool
39+
echo "$HOME/.dotnet/tools" >> "$GITHUB_PATH"
40+
41+
- name: Generate HTML coverage report
42+
if: always()
43+
run: |
44+
reportgenerator \
45+
-reports:"tests/HubDocs.UnitTests/TestResults/**/coverage.cobertura.xml" \
46+
-targetdir:"coverage-report" \
47+
-reporttypes:"Html;MarkdownSummary"
48+
3549
- name: Upload coverage artifacts
3650
if: always()
3751
uses: actions/upload-artifact@v4
3852
with:
3953
name: test-coverage-cobertura
4054
path: tests/HubDocs.UnitTests/TestResults/**/coverage.cobertura.xml
55+
56+
- name: Upload HTML coverage report
57+
if: always()
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: test-coverage-html
61+
path: coverage-report

0 commit comments

Comments
 (0)