1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: CI
on:
push:
branches:
pull_request:
branches:
env:
CARGO_TERM_COLOR: always
jobs:
# ── Code quality checks ──
check:
name: check (stable)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Format check
run: cargo fmt --all --check
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
# ── Build & test ──
test:
name: test (stable)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --verbose
- name: Test
run: cargo test --verbose
# ── Documentation check ──
doc:
name: doc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- name: Check documentation
run: cargo doc --no-deps --document-private-items
env:
RUSTDOCFLAGS: -D warnings
# ── Coverage gate ──
#
# Fails the build if line coverage drops below the threshold. This turns the
# test-backfill phase (B1–B5) into a durable constraint: any PR that lowers
# coverage below the floor is rejected.
#
# Measured 2026-08-13 after B1–B5: 90.83% line coverage (cargo llvm-cov,
# library target). Threshold is set at 90 to ratchet the floor upward while
# leaving ~80 lines of headroom to absorb CI machine variance.
#
# NOTE: this number includes `#[cfg(test)]` modules (which run ~100%), so it
# is a nominal floor, not the "real library code only" figure. Re-measure with
# `cargo llvm-cov --summary-only` and ratchet the threshold upward as real
# coverage improves.
coverage:
name: coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- uses: Swatinem/rust-cache@v2
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Coverage gate
run: cargo llvm-cov --fail-under-lines 90