Skip to content

Commit

Permalink
Add coverage summary to build results
Browse files Browse the repository at this point in the history
  • Loading branch information
btburnett3 committed Dec 15, 2024
1 parent 10ac04f commit ee6639d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
with:
name: coverage-${{ matrix.framework }}-${{ matrix.disable }}
path: Snappier.Tests/TestResults/**/*.xml

retention-days: 1

test-windows:

Expand Down Expand Up @@ -78,6 +78,7 @@ jobs:
with:
name: coverage-net4
path: Snappier.Tests/TestResults/**/*.xml
retention-days: 1

coverage-report:

Expand All @@ -97,20 +98,27 @@ jobs:
uses: actions/download-artifact@v4
with:
pattern: coverage-*
path: Snappier.Tests/TestResults
path: TestResults
- name: Cleanup Windows Coverage
run: |
find ./TestResults/coverage-net4 -type f -name '*.xml' | xargs sed -i 's|[A-Z]:.*\\Snappier\\Snappier\\Snappier\\|${{ github.workspace }}/Snappier/|g'
shell: bash
- name: ReportGenerator
uses: danielpalme/ReportGenerator-GitHub-Action@v5
with:
reports: 'Snappier.Tests/TestResults/**/*.xml'
reports: 'TestResults/**/*.xml'
targetdir: 'artifacts/coveragereport'
reporttypes: 'Html'
reporttypes: 'Html;MarkdownSummaryGithub'
classfilters: '-System.Diagnostics.*;-System.Runtime.*;-Snappier.Internal.ThrowHelper'
license: ${{ secrets.REPORT_GENERATOR_LICENSE }}
- name: Collect Report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: artifacts/coveragereport
- name: Add to Build Summary
run: cat artifacts/coveragereport/SummaryGithub.md >> $GITHUB_STEP_SUMMARY # Adjust path and filename if necessary
shell: bash

publish:

Expand Down

0 comments on commit ee6639d

Please sign in to comment.