-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (71 loc) · 2.98 KB
/
Copy pathdependencies.yaml
File metadata and controls
84 lines (71 loc) · 2.98 KB
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
---
name: dependencies
"on":
pull_request:
paths:
- Cargo.lock
- Cargo.toml
- "**/Cargo.toml"
- config/deny.toml
- config/osv-scanner.toml
- .github/workflows/dependencies.yaml
- .github/actions/install-mise/**
workflow_dispatch:
permissions:
contents: read
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}
env:
MISE_ENV: dart,dotnet,java,js,python,rust,zig
jobs:
dependencies:
# Use `ubuntu-latest`, not `ubuntu-slim`, for this workflow.
# Although every step here is metadata/network-bound (no Rust compile), `taiki-e/install-action` itself assumes
# a standard runner-image FHS (e.g. ~/.cargo/bin) and fails on slim's bare container with
# `I/O Error: No such file or directory` while staging cargo-unmaintained. Slim only fits workflows whose first
# step doesn't need that scaffolding.
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
persist-credentials: false
- name: Install mise + dependency-scan tools
uses: ./.github/actions/install-mise
with:
install-action-tools: cargo-deny,cargo-unmaintained,coreutils,osv-scanner,ripgrep
- name: Generate config/osv-scanner.toml from config/deny.toml
run: mise run gen:osv-scanner
- name: cargo deny check
run: mise run cargo-deny-check
- name: osv-scanner
run: mise run osv-scanner
# Restore cached `cargo unmaintained` lookups to keep reruns fast.
# `cargo unmaintained` persists per-repository archival/last-commit lookups under
# `$XDG_CACHE_HOME/cargo-unmaintained` (default `~/.cache/cargo-unmaintained`, with a versioned `v2/` subdir).
# On a cold runner the per-dependency GitHub round-trips take ~12 min, which nearly blew the old 15-min
# timeout. Key on Cargo.lock so a dependency change refreshes; the prefix restore-key reuses the previous
# cache for crates that didn't change.
- name: Cache cargo-unmaintained lookups
uses: actions/cache@v4
with:
path: ~/.cache/cargo-unmaintained
key: cargo-unmaintained-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-unmaintained-
# Provide a token so `cargo unmaintained` can run its archival check.
# `cargo unmaintained` queries the GitHub API to check whether each declared upstream repository is
# archived. Without a token the archival check is skipped with a warning, leaving an unmaintained archived
# crate undetected.
- name: cargo unmaintained
env:
GITHUB_TOKEN: ${{ github.token }}
run: mise run cargo-unmaintained-check
- name: Check config/osv-scanner.toml is committed
run: git diff --exit-code -- config/osv-scanner.toml