ci: cache pip packages for the ScanCode license scan#54
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
aboutcode-org/scancode-action) installsscancodeioviapip install --upgradedirectly on the runner on every run, with no caching — adding several minutes per run to re-download the same wheels.actions/cachestep (same pin already used for the Playwright cache inci.yml) targeting~/.cache/pip, keyed on${{ runner.os }}-pip-scancode-${{ github.run_id }}with a prefixrestore-keysfallback. There's no lockfile to hash against since the action always installs "latest," so this run_id-in-key idiom guarantees a fresh cache save every run while still restoring the most recent prior cache as a warm starting point (never stale, never starts cold after the first run).Test plan
Cache pip packages for ScanCodestep shows a cache hit/restore on the second run of this workflow (first run on this PR will be a cold miss, as expected)🤖 Generated with Claude Code