Skip to content

ci: add code coverage summary and badge - #14

Merged
capjan merged 1 commit into
mainfrom
ci/coverage-badge
Sep 25, 2026
Merged

capjan merged 1 commit into
mainfrom
ci/coverage-badge

Conversation

@capjan

@capjan capjan commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • The test step now collects coverage with the already referenced coverlet.collector.
  • On ubuntu, .github/scripts/coverage-badge.py turns the Cobertura report into a per-class Markdown table (job summary) and a coverage.svg badge.
  • On pushes to main, the badge is force-pushed as a single commit to the badges branch using the built-in GITHUB_TOKEN (contents: write on the job). No external service and no extra secret.
  • README shows the badge under the .NET badge.

Current local numbers: 97.5% lines, 83.0% branches.

Notes

  • The badge image is broken until the first run on main has created the badges branch.
  • PRs only get the job summary, the badge is not updated there.
  • Not yet exercised in GitHub Actions; the script was run locally against a real report.

Collect coverage with coverlet in the test step, write a per-class summary
to the job summary and publish a self-generated badge to the badges branch
on pushes to main. No external service or extra secret needed.
@capjan
capjan merged commit 7bdedf0 into main Sep 25, 2026
3 checks passed
@capjan
capjan deleted the ci/coverage-badge branch September 25, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant