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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
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@v7`).
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@v7
- 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@v7
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Check all features
run: cargo check --workspace --all-features
- name: Clippy check (all features)
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
- name: Clippy check (default features)
run: cargo clippy --workspace --all-targets -- -D warnings
# The build-test matrix above never enables `async`, `log`,
# `tracing`, `jitter`, `registry`, `collector` or `context`, so
# the tests gated on those features only run here.
- name: Test all features
run: cargo test --workspace --all-features
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- 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, then runs the tests.
msrv:
name: MSRV (Rust 1.81)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/rust-toolchain@1.81.0
- name: Build (all features)
run: cargo +1.81.0 build --workspace --all-features
# The committed lockfile tracks the newest dev-dependencies, and
# some of them (`trybuild`, its `toml` stack) need a newer Rust.
# Re-resolve with the MSRV-aware resolver so the tests build on
# 1.81. Runtime dependencies are already covered by the build
# step above, which uses the committed lockfile.
- name: Resolve 1.81-compatible dev-dependencies
env:
CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: fallback
run: cargo +stable update
# The UI test compares compiler output recorded on stable, so it
# only runs in the stable jobs.
- name: Test (all features)
run: cargo +1.81.0 test --workspace --all-features -- --skip trybuild_ui_tests
# Checks that the version floors declared in `Cargo.toml` really
# build: every direct dependency is resolved to the lowest version
# its requirement allows, then the crate is built on the MSRV.
# Dev-dependencies are dropped first; they only serve the tests and
# their floors would otherwise constrain the runtime ones.
minimal-versions:
name: Minimal versions (Rust 1.81)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/rust-toolchain@1.81.0
- name: Install cargo-hack
uses: taiki-e/install-action@v2
with:
tool: cargo-hack
- name: Drop dev-dependencies
run: cargo hack --remove-dev-deps --workspace
- name: Resolve direct dependencies to their minimum versions
run: cargo +nightly update -Z direct-minimal-versions
- name: Build (all features)
run: cargo +1.81.0 build --workspace --all-features
- name: Build (no default features)
run: cargo +1.81.0 build --workspace --no-default-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@v7
- uses: dtolnay/rust-toolchain@stable
# Prebuilt binary instead of `cargo install`, which compiled
# cargo-audit from source on every run.
- name: Install cargo-audit
uses: taiki-e/install-action@v2
with:
tool: 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@v7
- uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check all