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
name: CI
on:
push:
branches:
pull_request:
branches:
# Node.js 20 was deprecated on GitHub Actions runners on 2025-09-19
# and will be removed on 2026-09-16; the default JavaScript-action
# runtime switches to Node.js 24 on 2026-06-02. We set this flag
# now so every JS-action step in this workflow runs on Node 24,
# regardless of which Node version the action itself declares. The
# flag is a no-op for the actions that already target Node 24
# natively (e.g. `actions/checkout@v5`).
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
jobs:
build-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
features:
- ""
- derive
- serde
- console
- backtrace
- "derive serde"
- "derive console"
- "derive backtrace"
- "derive serde console backtrace"
steps:
- uses: actions/checkout@v5
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Run tests
run: |
echo "Testing with features: ${{ matrix.features }}"
cargo test --workspace --no-default-features --features "${{ matrix.features }}"
full-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Check all features
run: cargo check --workspace --all-features
- name: Clippy check
run: cargo clippy --workspace --all-features -- -D warnings
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Check documentation
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --workspace --all-features --no-deps
# MSRV verification. `rust-version` in `Cargo.toml` declares the
# floor; this job builds on that exact toolchain to catch any
# accidental use of newer-than-MSRV APIs.
msrv:
name: MSRV (Rust 1.81)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@1.81.0
- name: Build (all features)
run: cargo build --workspace --all-features
# Security advisory scan. Runs `cargo audit` against the RustSec
# database on every push so deprecated / vulnerable transitive
# crates surface immediately.
#
# We invoke `cargo audit` directly rather than through
# `rustsec/audit-check`, which is a Node.js 20 JavaScript action
# (deprecated by GitHub on 2025-09-19, removed 2026-09-16). The
# `cargo-deny` job below runs in parallel and overlaps coverage;
# this job is the lightweight RUSTSEC-database-only scan.
audit:
name: cargo audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- name: Install cargo-audit
run: cargo install --locked cargo-audit
- name: Run cargo audit
run: cargo audit --deny warnings
# License + duplicate-version policy enforcement via `cargo deny`.
# The `deny.toml` config in the repo root pins the allow-list of
# permissive licenses, bans wildcard version requirements, and
# restricts dep sources to `crates.io`.
deny:
name: cargo deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check all