Skip to content

Commit 0722ce0

Browse files
authored
Implement cargo-deny checks in CI workflows and update dependencies. Add a new deny.toml configuration for license and advisory management. Update Cargo.toml for bench-support and ensure consistent versioning across dependencies. (#45)
1 parent a4953e4 commit 0722ce0

5 files changed

Lines changed: 86 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,19 @@ jobs:
160160
with:
161161
token: ${{ secrets.GITHUB_TOKEN }}
162162

163+
# Dependency policy checks across all execution paths
164+
cargo-deny:
165+
name: Cargo Deny
166+
runs-on: ubuntu-latest
167+
steps:
168+
- uses: actions/checkout@v6
169+
- uses: actions-rust-lang/setup-rust-toolchain@v1
170+
- uses: Swatinem/rust-cache@v2
171+
- name: Install cargo-deny
172+
run: cargo install --locked cargo-deny
173+
- name: Run cargo-deny checks
174+
run: cargo deny check all
175+
163176
# Benchmarks (only on the main branch)
164177
bench:
165178
name: Benchmarks

.github/workflows/maintenance.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,28 @@ permissions:
1212
contents: read
1313

1414
jobs:
15-
security-audit:
16-
name: Security Audit
15+
# Weekly dependency policy drift check.
16+
dependency-policy:
17+
name: Dependency Policy (cargo-deny)
1718
runs-on: ubuntu-latest
19+
timeout-minutes: 20
1820
steps:
1921
- uses: actions/checkout@v6
20-
- uses: rustsec/audit-check@v2
21-
with:
22-
token: ${{ secrets.GITHUB_TOKEN }}
22+
- uses: actions-rust-lang/setup-rust-toolchain@v1
23+
- uses: Swatinem/rust-cache@v2
24+
- name: Install cargo-deny
25+
run: cargo install --locked cargo-deny
26+
- name: Check advisories, bans, licenses, and sources
27+
run: cargo deny check all
2328

29+
# Weekly toolchain drift check against latest stable.
2430
latest-stable-smoke:
2531
name: Latest Stable Smoke
2632
runs-on: ubuntu-latest
33+
timeout-minutes: 30
2734
steps:
2835
- uses: actions/checkout@v6
2936
- uses: actions-rust-lang/setup-rust-toolchain@v1
3037
- uses: Swatinem/rust-cache@v2
31-
- name: Build and test
32-
run: cargo test --all-features --all-targets
38+
- name: Build and test workspace
39+
run: cargo test --workspace --all-features --all-targets

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ parking_lot = { version = "0.12", optional = true }
8383
rustc-hash = "2.1"
8484

8585
[dev-dependencies]
86-
bench-support = { path = "bench-support" }
86+
bench-support = { path = "bench-support", version = "0.1.0" }
8787
criterion = "0.8"
8888
dhat = "0.3"
8989
lru = "0.16"

bench-support/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ name = "render_docs"
99
path = "src/bin/render_docs.rs"
1010

1111
[dependencies]
12-
cachekit = { path = "..", features = ["policy-all"] }
12+
cachekit = { path = "..", version = "0.4.0", features = ["policy-all"] }
1313
criterion = "0.8"
1414
rand = "0.10"
1515
rand_distr = "0.6"

deny.toml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
[licenses]
2+
confidence-threshold = 0.93
3+
unused-allowed-license = "warn"
4+
include-build = true
5+
include-dev = true
6+
allow = [
7+
"MIT",
8+
"Apache-2.0",
9+
]
10+
11+
[licenses.private]
12+
ignore = true
13+
14+
[[licenses.exceptions]]
15+
crate = "unicode-ident"
16+
allow = ["Unicode-3.0"]
17+
18+
[[licenses.exceptions]]
19+
crate = "foldhash"
20+
allow = ["Zlib"]
21+
22+
[graph]
23+
targets = [
24+
"x86_64-unknown-linux-gnu",
25+
"x86_64-apple-darwin",
26+
"aarch64-apple-darwin",
27+
"x86_64-pc-windows-msvc",
28+
]
29+
all-features = true
30+
exclude-dev = false
31+
32+
[advisories]
33+
ignore = []
34+
35+
[bans]
36+
multiple-versions = "deny"
37+
wildcards = "deny"
38+
highlight = "all"
39+
workspace-default-features = "allow"
40+
external-default-features = "allow"
41+
allow = []
42+
deny = []
43+
skip = []
44+
skip-tree = []
45+
46+
[sources]
47+
unknown-registry = "deny"
48+
unknown-git = "deny"
49+
allow-registry = [
50+
"https://github.com/rust-lang/crates.io-index",
51+
]
52+
allow-git = []
53+
54+
[sources.allow-org]
55+
github = []
56+
gitlab = []
57+
bitbucket = []

0 commit comments

Comments
 (0)