Skip to content

Commit 09fc7c9

Browse files
tbjersclaude
andcommitted
ci: cache pip packages for the ScanCode license scan
The ScanCode action installs scancodeio via pip on every run with no cache, adding several minutes per run just to re-download the same wheels. Caches ~/.cache/pip using a run_id-keyed cache with a prefix restore-key, so each run seeds from the most recent prior cache while still saving a fresh snapshot every time. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 714b8ca commit 09fc7c9

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

.github/workflows/scancode.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ jobs:
2020
with:
2121
path: scancode-inputs
2222

23+
# scancode-action installs scancodeio via `pip install --upgrade` on every run with
24+
# no lockfile to key on, so this uses the run_id-in-key / prefix-restore-keys idiom:
25+
# always misses the exact key (guaranteeing a fresh save from this run's pip cache)
26+
# while still restoring the most recent prior cache as a warm starting point.
27+
- name: Cache pip packages for ScanCode
28+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
29+
with:
30+
path: ~/.cache/pip
31+
key: ${{ runner.os }}-pip-scancode-${{ github.run_id }}
32+
restore-keys: |
33+
${{ runner.os }}-pip-scancode-
34+
2335
- uses: aboutcode-org/scancode-action@e46d127dfbe502ad2699fbbba8efedad1b2adbd1 # beta
2436
with:
2537
pipelines: "scan_codebase"

0 commit comments

Comments
 (0)