Skip to content

Report test coverage on builds and pull requests - #21

Merged
AndrewMcLachlan merged 1 commit into
mainfrom
feature/coverage-report
Jul 26, 2026
Merged

Report test coverage on builds and pull requests#21
AndrewMcLachlan merged 1 commit into
mainfrom
feature/coverage-report

Conversation

@AndrewMcLachlan

Copy link
Copy Markdown
Owner

Changes

The build has always collected Cobertura coverage (coverage.runsettings, scoped to Postie.* minus tests and samples) but only uploaded the raw XML as an artifact. This adds the reporting layer, following the same approach as the ASM repo:

  • ReportGenerator turns the Cobertura files into a per-assembly markdown summary.
  • A sticky PR comment posts the summary on pull requests and updates in place on each push.
  • The summary is written to the job summary on every run, PRs and main alike.

Postie's single test invocation means no separate coverage job or artifact merge is needed (unlike ASM's 16-project matrix) — three steps in the existing build job. The job gains pull-requests: write for the comment; both new actions are pinned by commit SHA per this repo's convention.

Known limitation (same as ASM): fork PRs get a read-only token, so the comment step can't post there — the job summary still covers it.

This PR should demonstrate the feature on itself.

🤖 Generated with Claude Code

The build already collected Cobertura coverage but only uploaded the raw
XML. ReportGenerator now produces a per-assembly markdown summary, posted
as a sticky PR comment and written to the job summary on every run.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Summary

Line coverage Branch coverage

Assembly Line coverage Branch coverage
Postie.AspNetCore 97.9% 91.3%
Postie.AspNetCore.FluentValidation 100% 100%
Postie.AspNetCore.MediatR 100% 100%
Postie.Cqrs 99.3% 94.5%
Postie.Cqrs.AspNetCore 100% 100%
Postie.Cqrs.FluentValidation 100% 93.7%

@AndrewMcLachlan
AndrewMcLachlan merged commit 68e83e2 into main Jul 26, 2026
6 checks passed
@AndrewMcLachlan
AndrewMcLachlan deleted the feature/coverage-report branch July 26, 2026 01:19
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