Repository navigation
Share one dependency cache across CI jobs - #1497
Draft
cristianrgreco wants to merge 5 commits into
Draft
cristianrgreco wants to merge 5 commits into
cristianrgreco wants to merge 5 commits into
Conversation
Make npm-setup install every workspace by default, so Lint, Compile and the test jobs restore the same cache instead of one per package. The smoke tests keep a testcontainers-only install through the new `workspace-only` input.
cristianrgreco
added this pull request to stack #1498
October 10, 2026 20:35
Leave npm-setup as it was: `workspace` installs only that workspace, and no workspace installs everything. The test jobs now call it without a workspace and resolve their own test path, so they share the full-install cache. The smoke tests are unchanged.
The smoke tests' prune step removes the same packages after a full install as after a testcontainers-only one, so they don't need an install of their own. With no caller left, npm-setup always installs every workspace.
This branch has not been deployed
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.
Stacked on #1496, which is stacked on #1495 and #1492. Review and merge those first.
Summary
Every job that installs dependencies now restores one shared cache per Node version, instead of one cache per package.
npm-setuploses itsworkspaceinput andworkspace_pathoutput. It always runsnpm cifor every workspace, with one cache key per runner, Node version and lockfile.test-template.ymlworks out the path of the package under test itself.Why
The repository is over GitHub's 10 GB Actions cache limit (10.8 GB), so caches are being evicted and jobs fall back to
npm ci. On the last all-green run, the install step in the 176 test jobs took 7s at the median and up to 32s.Trade-offs
npm prune --omit=dev --workspace packages/testcontainersremoves the same 11 packages after either install (336 to 325 with atestcontainers-only install, 1126 to 1115 with a full one). The one case that's weaker: a packagetestcontainersneeds at runtime but lists only as a dev dependency now goes unnoticed if any module also depends on it, where before only the root counted. The step never gave a production-only environment: vitest, TypeScript and Biome stay installed after it either way.npm ci(35s on CI) until one saves the cache. Today every job also misses on a lockfile change, since each per-package key includes the lockfile hash.Verification
action.yml,checks.ymlandtest-template.ymlparse.npm run format: no fixes applied.TEST_PATHexpression intest-template.yml, which GitHub evaluates. It yieldspackages/testcontainersfortestcontainersandpackages/modules/<name>otherwise, the same paths the action returned before.Checksworkflow only runs for PRs that targetmain, so it won't run on this PR until the PRs below it merge and this one is retargeted. The cache figures above are from the existing caches and from the shared cache that Detect unused code and dependencies with knip #1492's Knip job created.Why this isn't breaking
CI-only. No package source, dependency or published file changes.