Skip to content

ci: publish coverage badges from develop runs - #49

Merged
artempartos merged 1 commit into
developfrom
ci/coverage-badges
Aug 7, 2026
Merged

artempartos merged 1 commit into
developfrom
ci/coverage-badges

Conversation

@artempartos

Copy link
Copy Markdown
Contributor

What

Publishes backend and frontend line coverage as README badges, refreshed by every green push to develop.

How

  1. code-check.yml mounts the container's coverage/ directory out — docker compose run otherwise discards it — and exports the percentage as a workflow_call output: .result.line from SimpleCov's .last_run.json (backend job) or .total.lines.pct from Vitest's coverage-summary.json (frontend job). Only when run-coverage: 1, which is already develop-pushes-only.
  2. ci.yml gains a coverage-badges job (push to develop, contents: write) that renders the two numbers into shields.io endpoint documents and commits them to an orphan badges branch via git worktree, so a badge refresh never lands a bot commit in develop's history.
  3. README.md gets a CI status badge plus the two coverage badges.

Colour thresholds: ≥90 brightgreen, ≥80 green, ≥70 yellowgreen, ≥60 yellow, ≥50 orange, else red. At today's numbers that renders backend 90.3% brightgreen and frontend 78.34% yellowgreen.

No third-party coverage service, no account, no secret beyond GITHUB_TOKEN — Codecov was the alternative but wants an org account and a token in exchange for PR diff-coverage comments.

Verification

  • actionlint clean on both workflows (the one remaining warning is pre-existing, in images.yml)
  • badge script dry-run locally in throwaway repos, both paths: orphan-branch creation (branch ends up holding only the two JSON files, no repo contents leak) and the update path against an existing remote badges branch, including the push
  • jq filters checked against real report files from a local check_all: 90.0 and 78.34
  • docker compose exec -T web make check_all — all green

Note

The badges branch does not exist yet, so the two coverage badges render as unavailable until this merges and develop runs once.

🤖 Generated with Claude Code

The suite has measured line coverage on every develop push since #288, but the
number only ever appeared in a job log. Surface it on the README instead, so
the repository shows where the project actually stands.

code-check.yml mounts the container's coverage directory out (nothing else
does — `docker compose run` discards it) and exports the percentage as a
workflow_call output: SimpleCov's .last_run.json for the backend job, Vitest's
coverage-summary.json for the frontend one. A new ci.yml job renders those into
shields.io endpoint documents on an orphan `badges` branch, so refreshing a
badge never puts a bot commit in develop's history.

No third-party coverage service and no secret beyond GITHUB_TOKEN. The badges
appear once this lands and develop runs; until then the endpoints 404 and
shields renders them as unavailable.

Co-Authored-By: Claude Opus 5 <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>
@artempartos
artempartos merged commit 986d78c into develop Aug 7, 2026
7 checks passed
alex-astafyev pushed a commit to alex-astafyev/flow that referenced this pull request Aug 19, 2026
* origin/develop:
  feat(resources): unify Agents/Wrappers/Repositories/Integrations tables (AixleHQ#51)
  feat(personal-mcp): add trigger, authoring and diagnostic tools (AixleHQ#52)
  ci: stop cancelling develop runs when merges land back to back (AixleHQ#50)
  fix(container-runtime): honor the timeout option on Docker exec
  fix(container-runtime): honor the timeout option on Docker exec (AixleHQ#48)
  ci: publish coverage badges from develop runs (AixleHQ#49)

# Conflicts:
#	.github/workflows/ci.yml
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