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
name: CI
# Runs on every push to main and every pull request so the test suite and
# the >=80% line-coverage gate guard ordinary development — not just tag
# publishes (which publish.yml handles). fmt + clippy + tests + coverage all
# block a merge below the floor.
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test Suite + Coverage Gate
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all -- --check
- name: Check clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
# nextest natively detects+reports flaky tests (failed-then-passed on
# retry shows as "FLAKY" in the run summary instead of silently passing
# or hard-failing on a one-off). Tests share RwLock-protected
# EpochManager state, so they MUST run single-threaded (--test-threads=1).
- name: Run tests (nextest, flaky-aware)
run: cargo nextest run --all-features --retries 2 --test-threads=1
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
# Coverage gate: line coverage must stay at or above 80%. `--fail-under-lines 80`
# fails the build on a regression below the floor. The crate currently
# measures ~99.9% lines. Uses the nextest runner so retried-flaky tests
# are reported the same way as the plain test step above. --retries/--test-threads
# are `cargo nextest run` options, not test-binary args, so they MUST come
# BEFORE the `--` separator (args after `--` go to the test binary itself and
# nextest rejects `--retries`/`--test-threads` there with "arguments are unsupported").
- name: Coverage (>=80% lines)
run: cargo llvm-cov nextest --all-features --retries 2 --test-threads=1 --summary-only --fail-under-lines 80
- name: Check documentation
run: cargo doc --no-deps --all-features