|
1 | 1 | name: Dependency & License Review |
2 | 2 |
|
3 | | -# Automatically detects stale dependencies, license drift, and security |
4 | | -# advisories on every push/PR that touches Cargo files, and on a weekly |
5 | | -# schedule so that newly published advisories are caught promptly. |
| 3 | +# Unique dependency-review gates (stale deps, lockfile diff, license inventory, |
| 4 | +# cargo-deny on dep changes). cargo-audit is intentionally NOT duplicated here: |
| 5 | +# - PR/push: ci.yml `security-audit` |
| 6 | +# - Schedule: security-audit.yml |
6 | 7 | # |
7 | | -# Addresses GitHub Issue #1119. |
| 8 | +# Addresses GitHub Issue #1119; deduplicated in #1219. |
8 | 9 |
|
9 | 10 | on: |
10 | 11 | push: |
|
22 | 23 | - "deny.toml" |
23 | 24 | - ".cargo/audit.toml" |
24 | 25 | schedule: |
25 | | - # Run weekly on Mondays at 08:00 UTC to catch newly published advisories. |
| 26 | + # Run weekly on Mondays at 08:00 UTC for stale-deps + license inventory. |
26 | 27 | - cron: "0 8 * * 1" |
27 | 28 | workflow_dispatch: |
28 | 29 | inputs: |
|
43 | 44 | CARGO_TERM_COLOR: always |
44 | 45 |
|
45 | 46 | jobs: |
46 | | - # ── 1. cargo audit — known vulnerabilities ────────────────────────────────── |
47 | | - cargo-audit: |
48 | | - name: Cargo Audit (Vulnerabilities) |
49 | | - runs-on: ubuntu-latest |
50 | | - timeout-minutes: 10 |
51 | | - steps: |
52 | | - - uses: actions/checkout@v4 |
53 | | - |
54 | | - - name: Setup Rust |
55 | | - uses: ./.github/actions/setup-rust |
56 | | - with: |
57 | | - cache-key: "ci-audit" |
58 | | - extra-tools: "cargo-audit" |
59 | | - |
60 | | - - name: Install cargo-audit |
61 | | - run: | |
62 | | - for i in 1 2 3; do |
63 | | - cargo install --locked cargo-audit && break |
64 | | - echo "Attempt $i failed, retrying..." |
65 | | - sleep 5 |
66 | | - done |
67 | | -
|
68 | | - - name: Run cargo audit |
69 | | - run: | |
70 | | - echo "── Security advisory audit ──────────────────────────────────────" |
71 | | - cargo audit |
72 | | -
|
73 | | - - name: Generate audit JSON report |
74 | | - if: always() |
75 | | - run: | |
76 | | - cargo audit --json 2>/dev/null > audit-report.json || true |
77 | | - echo "Audit report saved to audit-report.json" |
78 | | -
|
79 | | - - name: Upload audit report |
80 | | - if: always() |
81 | | - uses: actions/upload-artifact@v4 |
82 | | - with: |
83 | | - name: cargo-audit-report |
84 | | - path: audit-report.json |
85 | | - retention-days: 30 |
86 | | - |
87 | | - # ── 2. cargo deny — license + bans + advisories ───────────────────────────── |
| 47 | + # ── 1. cargo deny — license + bans + advisories ───────────────────────────── |
88 | 48 | cargo-deny: |
89 | 49 | name: Cargo Deny (Licenses + Bans) |
90 | 50 | runs-on: ubuntu-latest |
|
0 commit comments