Skip to content

Commit 978cc1c

Browse files
ci: add coverage summary to job summary and pr comment
Uses irongut/CodeCoverageSummary to parse cobertura XMLs and: - Write a coverage table + badge to the GitHub Actions job summary - Post a sticky PR comment with the coverage report Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent fb4f96b commit 978cc1c

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,25 @@ jobs:
8080
name: test-results
8181
path: junit/
8282
if-no-files-found: ignore
83+
84+
- name: Coverage summary
85+
if: always()
86+
uses: irongut/CodeCoverageSummary@v1.3.0
87+
with:
88+
filename: coverage/**/cobertura-coverage.xml
89+
badge: true
90+
fail_below_min: false
91+
format: markdown
92+
output: both
93+
thresholds: '60 80'
94+
95+
- name: Write coverage to job summary
96+
if: always()
97+
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
98+
99+
- name: Add coverage PR comment
100+
if: always() && github.event_name == 'pull_request'
101+
uses: marocchino/sticky-pull-request-comment@v2
102+
with:
103+
recreate: true
104+
path: code-coverage-results.md

0 commit comments

Comments
 (0)