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
name: CI
on:
push:
branches:
pull_request:
jobs:
ci:
name: Test, Lint, Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: Format check
run: cargo fmt --check
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Test (default features)
run: cargo test
- name: Test (all features)
run: cargo test --all-features
audit:
name: Security audit
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install cargo-audit
uses: taiki-e/install-action@cargo-audit
- name: Generate lockfile
# Cargo.lock is gitignored for this library, so resolve a fresh one and
# audit the dependency versions a downstream `cargo build` would get.
run: cargo generate-lockfile
- name: Run security audit
# --deny warnings promotes unsound/unmaintained/yanked advisories to
# failures instead of letting them accumulate silently. No advisory is
# ignored: the two that previously were (RUSTSEC-2024-0421 idna 0.5,
# RUSTSEC-2024-0370 proc-macro-error) came only through validator 0.18
# and were cleared by the validator 0.20 bump (v2.0.0) - 0.20 pulls
# idna 1.x and proc-macro-error3.
run: cargo audit --deny warnings