Skip to content

Commit a2f3404

Browse files
nolikclaude
andauthored
ci: add fmt/clippy/audit gates and pin toolchain to 1.97.0 (#602)
Adds quality gates to the PR workflow: - lint job: `cargo fmt --all -- --check` and `cargo clippy --all-targets --all-features -- -D warnings` (both already clean on the current tree) - audit job: rustsec/audit-check for dependency CVEs - rust-toolchain.toml pinned to 1.97.0 (matches the Dockerfile) so local, CI, and prod builds share one compiler. Audit triage (cargo audit found 3 vulnerabilities): - remove_dir_all RUSTSEC-2023-0018: fixed by bumping the transitive tempfile 3.3.0 -> 3.27.0 (drops remove_dir_all entirely). - rsa RUSTSEC-2023-0071 and tokio-tar RUSTSEC-2025-0111: no upstream fix and neither ships in the deployed binary (rsa is a phantom Cargo.lock entry from sqlx's unused mysql backend; tokio-tar is a testcontainers dev-dependency). Ignored via .cargo/audit.toml and the workflow's ignore input, with rationale. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 3d3779d commit a2f3404

4 files changed

Lines changed: 70 additions & 48 deletions

File tree

.cargo/audit.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# cargo-audit / rustsec advisory triage.
2+
# Both advisories below have NO fixed upgrade available and neither ships in
3+
# the deployed binary; revisit when upstream publishes a fix.
4+
[advisories]
5+
ignore = [
6+
# rsa timing sidechannel (Marvin). Phantom Cargo.lock entry pulled by
7+
# sqlx's unused mysql backend — not compiled into any target we build.
8+
"RUSTSEC-2023-0071",
9+
# tokio-tar PAX header smuggling. Dev-dependency only (testcontainers),
10+
# never present in the production artifact.
11+
"RUSTSEC-2025-0111",
12+
]

.github/workflows/build.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ env:
1212
CARGO_TERM_COLOR: always
1313

1414
jobs:
15+
lint:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v7
19+
- uses: Swatinem/rust-cache@v2
20+
- name: Format check
21+
run: cargo fmt --all -- --check
22+
- name: Clippy
23+
run: cargo clippy --all-targets --all-features -- -D warnings
24+
1525
build:
1626
runs-on: ubuntu-latest
1727
steps:
@@ -28,3 +38,18 @@ jobs:
2838
- uses: Swatinem/rust-cache@v2
2939
- name: Run E2E tests
3040
run: cargo test --tests --verbose
41+
42+
audit:
43+
runs-on: ubuntu-latest
44+
permissions:
45+
contents: read
46+
checks: write
47+
steps:
48+
- uses: actions/checkout@v7
49+
- name: Security audit
50+
uses: rustsec/audit-check@v2
51+
with:
52+
token: ${{ secrets.GITHUB_TOKEN }}
53+
# Advisories with no fix that don't ship in the deployed binary.
54+
# Kept in sync with .cargo/audit.toml (see there for rationale).
55+
ignore: RUSTSEC-2023-0071,RUSTSEC-2025-0111

Cargo.lock

Lines changed: 28 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust-toolchain.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[toolchain]
2+
# Keep in lockstep with the Rust version pinned in the Dockerfile so local,
3+
# CI, and production builds all use the same compiler.
4+
channel = "1.97.0"
5+
components = ["rustfmt", "clippy"]

0 commit comments

Comments
 (0)