Files
agentic-dev/.github/workflows/coverage-snapshot.yml
Danijel Martinek 093de02711 fix(tooling): restore L0 coverage sweep across all packages
The template baseline shipped 9 packages without @vitest/coverage-v8
and documented an L0 invocation turbo cannot parse — the full coverage
sweep had never run. Adds the provider (pinned to the feature-package
spec), a root test:coverage script, corrects every live doc/prompt/CI
occurrence, and calibrates coverage excludes for the 4 packages whose
latent threshold failures the outage masked (framework glue only —
zero threshold numbers changed). L0 sweep now passes 21/21.

Squash of a284baa + 5c6af95 (worktree-agent-a013c67cea83b2636),
implemented and reviewed via the dispatch loop under the epic's
baseline waiver (lint pending story 03).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016j8z4VHjedXDTjEDNg7qHK
2026-07-12 13:55:00 +02:00

73 lines
2.2 KiB
YAML

# Coverage snapshot — commits coverage/summary.json back to main after each
# merge so the trend history accumulates in `git log -- coverage/summary.json`
# (ADR-020 L2). This is the only workflow that needs `contents: write`.
#
# Skipped if summary.json hasn't changed since the previous commit.
name: Coverage snapshot
on:
push:
branches: [main]
# Avoid two snapshot runs racing each other on rapid-fire merges.
concurrency:
group: coverage-snapshot
cancel-in-progress: false
permissions:
contents: write
jobs:
snapshot:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: cms_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
with:
# Token with write scope so we can push the snapshot back.
token: ${{ secrets.GITHUB_TOKEN }}
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Test with coverage
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/cms_test
PAYLOAD_SECRET: test-secret-do-not-use-in-prod
run: pnpm test:coverage
- name: Aggregate
run: pnpm coverage:aggregate
- name: Commit summary.json if changed
run: |
if git diff --quiet --exit-code coverage/summary.json; then
echo "No summary.json change; skipping commit."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add coverage/summary.json
git commit -m "chore(coverage): snapshot ${GITHUB_SHA::7}
Auto-generated by .github/workflows/coverage-snapshot.yml.
[skip ci]"
git push origin HEAD:main