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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: CI
on:
push:
branches:
pull_request:
branches:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build-test:
name: Build, Test & Lint (Rust)
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, llvm-tools-preview
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
- name: Check formatting
run: cargo fmt --all -- --check
- name: Check clippy
run: cargo clippy --all-targets --all-features -- -D warnings
# Coverage MUST be collected via the combined `cargo llvm-cov nextest` form so llvm-cov
# drives nextest directly -- never run `cargo nextest run` and `cargo llvm-cov` as two
# separate steps, that collects zero coverage (the exact bug this fixes, #489).
#
# `--no-tests=warn` is a leftover safety net from when this crate's only test file was
# tests/parity.rs, a live-network `#[ignore]`d suite, so a normal nextest run matched ZERO
# tests and nextest's default `--no-tests` HARD ERROR (exit 4) failed the job before coverage
# was even measured. That is no longer the situation -- the offline suite is real now -- but
# the flag is kept so a future refactor that empties the suite reports an empty coverage
# report rather than a confusing exit 4.
#
# Coverage is measure-only, and the suite is NO LONGER empty: 104 offline tests pass, and
# `cargo llvm-cov --all-features` measured ~45% lines / 53% regions on 2026-08-10. Those two
# percentages are hand-recorded and drift unwatched -- trust the job's own summary output
# over this comment whenever they disagree. That is below the
# ecosystem's >= 80% floor, so the exemption that was justified by an empty suite is now
# simply debt. It is tracked in DIG-Network/dig_ecosystem#2612 -- which is also where the
# flip to the gated form belongs: `cargo llvm-cov nextest --fail-under-lines 80 --all-features
# --workspace --lcov --output-path lcov.info --retries 2`.
#
# (The two `#157` references this comment used to carry pointed at nothing: chia-query has no
# issue #157, and dig_ecosystem#157 is an unrelated closed ticket. The gap read as owned when
# it was not.)
#
# Runs via nextest with retries so a test that fails-then-passes is reported as FLAKY
# (not a hard failure) instead of silently passing or blocking the build (#489).
- name: Run tests with coverage (measure-only)
run: cargo llvm-cov nextest --all-features --workspace --lcov --output-path lcov.info --retries 2 --no-tests=warn
- name: Coverage summary
if: always()
run: cargo llvm-cov report --summary-only
- name: Upload coverage artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: lcov-coverage
path: lcov.info
if-no-files-found: warn
- name: Check documentation
run: cargo doc --no-deps --all-features
wasm-coinset:
name: Build & lint (wasm32 coinset-only)
runs-on: ubuntu-latest
# Proves the coinset REST tier stays wasm-clean: no native HTTP, no blst,
# no getrandom leak, none of the peer/CLVM stack reaches the wasm build.
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust toolchain (wasm32 target)
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: wasm32-unknown-unknown
components: clippy
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
- name: Build coinset-only for wasm32
run: cargo build --target wasm32-unknown-unknown --no-default-features --features coinset
- name: Clippy coinset-only for wasm32
run: cargo clippy --target wasm32-unknown-unknown --no-default-features --features coinset -- -D warnings