chore: reliable offline coverage reporting in local-ci - #89
Merged
Conversation
added 2 commits
July 4, 2026 12:33
…al-ci The offline CI now installs the reportgenerator global tool on demand (mirroring .github/workflows/test.yml) instead of silently skipping the coverage report when it is absent. It also emits the same report types as CI — HTML, Cobertura, TextSummary and MarkdownSummaryGithub — so a local run produces SummaryGithub.md, the offline equivalent of the coverage summary CI posts to the PR.
Since GitHub Actions minutes are limited, local-ci now produces the same coverage markdown as CI (SummaryGithub.md) and can optionally post it to a PR as a single sticky comment via the gh CLI, gated behind POST_COVERAGE_PR=<num>. It edits a prior marked comment instead of spamming, mirroring the CI sticky comment. Posting is opt-in and never runs unless the variable is set; all posting failures are warnings that never fail the pipeline.
Lint Results
|
This was referenced Jul 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
GitHub Actions minutes are a limited budget, and the full build + test + coverage matrix (
test.yml) is the most expensive workflow we run. Reserving it for every push/iteration burns through minutes fast.local-ci.shalready reproduces the build and tests offline — this PR makes its coverage reporting a first-class, reliable equivalent of what CI produces, so we can iterate locally and only spend Actions minutes when it actually matters.What changed (
scripts/local-ci.shonly)1. reportgenerator is now required, not optional
Previously the coverage step silently no-op'd if
reportgeneratorwasn't installed. Now it installs thedotnet-reportgenerator-globaltoolon demand (mirroringtest.yml) and puts the dotnet global-tools dir onPATH, so a local run always produces a coverage report.2. Same report artifacts as CI
Report types bumped from
TextSummaryonly →HtmlInline;Cobertura;TextSummary;MarkdownSummaryGithub— matchingtest.yml. A local run now emits:coverage/report/SummaryGithub.mdcoverage/report/index.htmlcoverage/report/Cobertura.xmlcoverage/report/Summary.txt3. Opt-in: post the summary to a PR as a single sticky comment
So the reliable local coverage can be shared on a PR without spending Actions minutes:
POST_COVERAGE_PR=88 ./scripts/local-ci.sh testPOST_COVERAGE_PR— never runs unless you set it.ghCLI. Finds a prior comment by a hidden marker (<!-- local-ci-coverage -->) and edits it instead of adding a new one, so repeated runs update one sticky comment — same UX as CI'ssticky-pull-request-comment.ghmissing, not authenticated, network) are warnings only — posting can never fail the pipeline.Notes
coverage/andtest-results/are already gitignored, so no artifacts get committed.Test
bash -n scripts/local-ci.sh— clean.reportgenerator ... -reporttypes:HtmlInline;Cobertura;TextSummary;MarkdownSummaryGithubagainst real cobertura output → producedSummaryGithub.md(27.3% line / 23.8% branch, 5 assemblies) + HTML + Cobertura.