perf(ci): cache node_modules, agent .venv, and Jest transforms in build workflow#202
Draft
scottschreckengaust wants to merge 3 commits into
Draft
perf(ci): cache node_modules, agent .venv, and Jest transforms in build workflow#202scottschreckengaust wants to merge 3 commits into
scottschreckengaust wants to merge 3 commits into
Conversation
Adds actions/cache for node_modules (keyed on yarn.lock) and agent/.venv (keyed on uv.lock). Includes timing instrumentation via SECONDS and ::notice annotations to measure cache-hit vs cold install performance across runs. Expected: Install step drops from ~75s (cold) to ~5s (cache hit). Refs #201 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sets cacheDirectory to <rootDir>/.jest-cache (off tmpfs, persists locally) and caches it in CI via actions/cache keyed on yarn.lock + commit SHA with restore-keys fallback for cross-branch reuse. Expected: test step drops from ~90s to ~40-50s on cache hit since ts-jest skips re-transpiling unchanged source files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
No-op commit to trigger a second CI run where caches are warm. Compare Install/Build timing annotations with the prior cold run. Co-Authored-By: Claude Opus 4.6 (1M context) <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
actions/cache@v4fornode_modules(keyed onyarn.lock),agent/.venv(keyed onuv.lock), and Jest transform cache (keyed onyarn.lock+ commit SHA with cross-branch restore-keys)cacheDirectoryto<rootDir>/.jest-cache— moves cache off tmpfs (fixes /tmp filling), enables persistence locally and in CI.jest-cacheto.gitignoreSECONDS+::notice) to measure cache-hit vs cold performanceHow to measure the improvement
The workflow logs cache status and timing in GHA annotations:
To compare:
::noticeannotations in workflow summaryTo drop the instrumentation after validation: Remove the
SECONDS=0/echo "::notice::"lines. The caching is the permanent change.Cache strategy
node_modulesnode-modules-{os}-{hash(yarn.lock)}agent/.venvagent-venv-{os}-{hash(agent/uv.lock)}jest-{os}-{hash(yarn.lock)}-{sha}jest-{os}-{hash(yarn.lock)}-Jest cache uses
restore-keysbecause partial cache (most files unchanged) is still beneficial. The others don't, because stalenode_modules/.venvwith wrong versions would break the build.Expected impact
Also fixes: Jest transform cache no longer fills
/tmptmpfs (was causing ENOSPC failures locally).Test plan
mise run buildstill passes.jest-cache/does not appear in git statusRefs #201
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com