3.1 KiB
CI and coverage
Jenkins must use a Multibranch Pipeline supplying BRANCH_NAME, with the
rust_no_docker worker, Python 3.11+, Rust, FFmpeg/FFprobe and the Typst CLI.
SCM credentials, webhooks and the publication mount are administrator setup.
CI checks formatting, Clippy, rustdoc, Python/Rust tests, real-media parity and
whole-workspace Rust coverage. It never creates tags or release artifacts.
Measurement
CI installs pinned cargo-llvm-cov 0.9.1 and llvm-tools-preview. The tracked
.cargo/config.toml alias cargo coverage expands to:
cargo llvm-cov --locked --workspace --all-features --json --summary-only --output-path coverage/summary.json
Run the same lifecycle locally (no publication):
python3 scripts/ci.py init
python3 scripts/ci.py coverage
python3 scripts/ci.py finalize
The enforced floor is 75% line coverage, configured in coverage.toml.
Ordinary production code, GUI and PDF code remain included. The gate compares
unrounded covered/count totals, logs the measurement and floor before PASS/FAIL,
and retains tool failure status even when a valid measurement exists.
init removes stale output. CI creates .tests-passed-${BUILD_NUMBER} only
after all required tests and parity pass. A valid measurement creates
.coverage-ready-${BUILD_NUMBER} even below the floor. Cleanup preserves that
measurement; unavailable coverage becomes neutral -%. Temporary
coverage/summary.json, diagnostics and markers are deleted after processing.
Generated badges and reports are ignored, never committed.
Badges
In post { cleanup }, Jenkins reads the version from root
Cargo.toml → workspace.package.version, renders current-build status, and
archives exactly these files with fingerprints and allowEmptyArchive: false:
coverage/version.svgcoverage/test.svgcoverage/coverage.svg
Only non-PR main builds publish, including failed builds, under
/mnt/assets/coverage/Beffroi/beffroi-tools/main/. The POSIX publication script
validates sources and destination components, writes atomically and never
synchronizes or prunes the shared mount.
Public URLs (also referenced once each below the README title):
- https://assets.dandaedre.com/coverage/Beffroi/beffroi-tools/main/version.svg
- https://assets.dandaedre.com/coverage/Beffroi/beffroi-tools/main/test.svg
- https://assets.dandaedre.com/coverage/Beffroi/beffroi-tools/main/coverage.svg
The renderer matches the maintained script from Dandaedre/agent-tasks,
revision 8923682b958de698c5ec41f4275bfc6f7e44a2f6, rechecked against the
coverage task.
tests/test_ci_badges.py covers threshold boundaries, tool failures, missing
measurements, SVG validation and safe publication to temporary directories.
Actual Jenkins archival/publication and public URL retrieval are separate external checkpoints. Local checks do not establish that badges are live. The asset server should mount assets read-only, disable listings, serve SVG with restrictive CSP, and revalidate mutable URLs or use a short cache lifetime.