Skip to content

ci: cache generate-lockfiles to skip ~47s on unchanged deps (#1076)#1083

Merged
lmeyerov merged 2 commits intomasterfrom
feat/issue-1076-cache-lockfiles
Apr 6, 2026
Merged

ci: cache generate-lockfiles to skip ~47s on unchanged deps (#1076)#1083
lmeyerov merged 2 commits intomasterfrom
feat/issue-1076-cache-lockfiles

Conversation

@lmeyerov
Copy link
Copy Markdown
Contributor

@lmeyerov lmeyerov commented Apr 6, 2026

Summary

  • Adds `actions/cache@v4` to the `generate-lockfiles` job, keyed on `setup.py`, `pyproject.toml`, `requirements/*.txt`, and `bin/generate-lockfiles.sh`
  • On cache hit, the `uv` install and lockfile generation steps are skipped entirely
  • `upload-artifact` always runs so downstream jobs always receive the lockfiles (from cache or freshly generated)
  • Adds `cooldown_days` `workflow_dispatch` input (default `6`) — pass `0` to force-refresh all lockfiles; value is included in the cache key so a `cd0` run always misses and stores its own entry

Observed speedup

Run type `generate-lockfiles` duration
Cold miss (first run / deps changed) ~26s
Cache hit (same deps) ~6s

~20s saved on cache hit (issue estimated ~47s; actual varies by runner load).

Test plan

  • Cold miss: CI run 24055215908 — Install uv + Generate lockfiles ran, cache stored
  • Cache hit: CI run 24055236377 — Install uv + Generate lockfiles skipped, Upload lockfiles succeeded
  • Cache bust (`cooldown_days=0`): CI run 24055315814 — new key `cd0-` missed, generation ran
  • All PR checks green

Closes #1076.

🤖 Generated with Claude Code

lmeyerov and others added 2 commits April 6, 2026 15:28
#1076)

Adds actions/cache@v4 keyed on setup.py + pyproject.toml + requirements/*.txt +
bin/generate-lockfiles.sh. On cache hit, uv install and lockfile generation are
skipped; upload-artifact always runs so downstream jobs receive lockfiles.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…1076)

workflow_dispatch now accepts cooldown_days (default 6). The cache key includes
the value so a cooldown_days=0 run bypasses stale cache and stores its own entry.
COOLDOWN_DAYS is passed through to generate-lockfiles.sh on generation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lmeyerov lmeyerov merged commit 0921067 into master Apr 6, 2026
215 checks passed
@lmeyerov lmeyerov deleted the feat/issue-1076-cache-lockfiles branch April 6, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: cache generate-lockfiles artifact to shave ~47s from critical path

1 participant