Skip to content

CI: publish a self-hosted coverage badge to gh-pages - #204

Merged
PaxMachinaOne merged 1 commit into
KafScale:mainfrom
novatechflow:ci/coverage-badge
Oct 17, 2026
Merged

PaxMachinaOne merged 1 commit into
KafScale:mainfrom
novatechflow:ci/coverage-badge

Conversation

@novatechflow

Copy link
Copy Markdown
Collaborator

Adds a coverage badge that CI generates itself, with no outside coverage service and no tokens. Based on main after #203.

  • The Go Coverage Gate job now exposes the gate total (from coverage.out via go tool cover -func) as a job output.
  • A new coverage-badge job runs only on pushes to main, with contents: write. It checks out gh-pages, writes badges/coverage.json in the shields.io endpoint format (brightgreen at 80% or above, yellow at 60% or above, red otherwise) and pushes it as a normal commit. If the value has not changed it skips the commit, and it retries with a rebase if gh-pages moved during the push.
  • README gets the badge: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/KafScale/platform/gh-pages/badges/coverage.json, linking to the CI workflow.

The badge shows a number after the first main run once this merges.

Checks: actionlint clean, license headers pass.

On pushes to main, a new coverage-badge job takes the gate total from
the Go Coverage Gate job and commits badges/coverage.json to gh-pages
in the shields.io endpoint format. Green at 80% or above, yellow at 60%
or above, red otherwise. No external coverage service or token.

README gets the matching shields.io endpoint badge.
@PaxMachinaOne
PaxMachinaOne merged commit bdfe559 into KafScale:main Oct 17, 2026
11 checks passed
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.

2 participants