Cache uv and Go binaries in CI workflows#224
Merged
Merged
Conversation
Replace `pip install uv` with astral-sh/setup-uv (pinned, cache enabled) in the check, windows, and pre-commit jobs so the locked env — including the Rust-backed sdists (pydantic-core/jiter/cryptography) — is restored from ~/.cache/uv keyed on uv.lock instead of re-downloaded/rebuilt every run. Cache the from-source actionlint/gitleaks builds in the check job keyed on scripts/gate_tool_pins.sh, skipping the `go install` compile on a hit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wboq6L5ujSodPxqbewP3tx
164bbd0 to
59bc84f
Compare
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
Optimize CI performance by caching the
uvpackage manager and Go-built gate binaries (actionlint,gitleaks) across workflow runs, reducing redundant downloads and compilation.Key Changes
Replace manual
uvinstallation withastral-sh/setup-uvaction across three jobs (ci,test-e2e,docs-snapshot):~/.cache/uv) keyed onuv.lock, avoiding re-downloads of locked dependencies including Rust-backed sdists (pydantic-core, jiter, cryptography)python -m pip install uvto a declarative actionAdd caching for Go gate binaries in the
cijob:actions/cachestep caches~/go/binkeyed onscripts/gate_tool_pins.shgo installonly runs on cache miss, skipping from-source compilation when binaries are cachedSeparate
uv sync --frozeninto its own step in thedocs-snapshotjob for clarityImplementation Details
if [ "$CACHE_HIT" != "true" ]) to skip compilation entirely on cache hitshttps://claude.ai/code/session_01Wboq6L5ujSodPxqbewP3tx