Skip to content

feat(badges): live README status badges (coverage, CI matrix, releases)#23

Merged
monsieurleberre merged 1 commit into
devfrom
feat/coverage-badges
Jun 14, 2026
Merged

feat(badges): live README status badges (coverage, CI matrix, releases)#23
monsieurleberre merged 1 commit into
devfrom
feat/coverage-badges

Conversation

@monsieurleberre

@monsieurleberre monsieurleberre commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Closes #22.

What

Adds a README status-badges capability for consumer repos, driven entirely from CI — no gist, no PAT.

  • update-badges.yaml (new reusable workflow) — writes shields.io endpoint JSON to an orphan badges branch of the caller repo using the built-in GITHUB_TOKEN. A single post-CI writer renders every badge file in one commit (one badge branch per repo, no concurrent-write races). Inputs: coverage-data ({slug,label,percent}[]coverage-<slug>.json), matrix-data ({lang,os,arch,passed}[]ci-<lang>-<os>-<arch>.json), badge-branch (default badges).
  • csharp-ci.yaml / scala-ci.yaml — new coverage output (integer line-coverage % from the coverage shard) and matrix-status output (per-shard {name,os,arch,passed}), each surfaced via a dedicated post-matrix job that reads uploaded artifacts (matrix-job outputs are last-writer-wins).
  • artifact-prefix input on both CI workflows (default csharp/scala) — namespaces per-run artifacts so two languages invoked in one caller run don't collide on coverage-percent / ci-result-<shard>.
  • Windows badge logo — emits a custom logoSvg (Simple Icons ships no windows/microsoft slug); Ubuntu/macOS keep namedLogo. The matrix badge label is arch-only (the OS is conveyed by the logo and the README table column).
  • Helpers (unit-tested): extract_coverage.py, coverage_badge_json.py, matrix_badge_json.py, aggregate_matrix_status.py; write-badges.sh does the git plumbing.

Verification

  • python3 -m unittest discover -s test -p '*_test.py'48 passed
  • actionlint clean on all three workflows
  • Live end-to-end test on the daml-codegen-csharp pilot (PR feat(ci): default CI runner from repository visibility + cut v1.3.0 #9): badges render on the badges branch — C# coverage 97%, Scala 92%, per-platform CI badges with logos, and a grey "not supported" cell for the Scala Windows/arm64 shard.

Notes

Copilot AI review requested due to automatic review settings June 14, 2026 09:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings June 14, 2026 13:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings June 14, 2026 13:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Add an `update-badges.yaml` reusable workflow that writes shields.io endpoint
JSON to an orphan `badges` branch of the caller repo (built-in GITHUB_TOKEN,
no gist or PAT), fed by new `coverage` and `matrix-status` outputs on csharp-ci
and scala-ci, so consumer READMEs can show live coverage and per-platform CI
badges alongside the standard release/version badges.
@monsieurleberre monsieurleberre changed the title feat: coverage badge workflow + csharp-ci coverage output (#22) feat(badges): live README status badges (coverage, CI matrix, releases) Jun 14, 2026
@monsieurleberre monsieurleberre merged commit 6aeabfa into dev Jun 14, 2026
2 checks passed
@monsieurleberre monsieurleberre deleted the feat/coverage-badges branch June 14, 2026 13:52
monsieurleberre added a commit that referenced this pull request Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate Schneegans/dynamic-badges-action for default README badges (CI, NuGet versions, OS/arch matrix, coverage)

2 participants