Skip to content

chore: cache npm deps in CI and update actions to v7 - #207

Merged
magnus-madsen merged 1 commit into
masterfrom
cache-npm-in-ci
Aug 8, 2026
Merged

magnus-madsen merged 1 commit into
masterfrom
cache-npm-in-ci

Conversation

@magnus-madsen

@magnus-madsen magnus-madsen commented Aug 8, 2026 •

Copy link
Copy Markdown
Member

Adds cache: npm to actions/setup-node so npm ci restores package tarballs from cache rather than re-downloading them on every run. The cache key defaults to package-lock.json at the repo root. Both matrix legs share a single cache entry — setup-node caches ~/.npm, npm's content-addressed tarball store, which is independent of the Node version.

Also bumps the actions to their current majors:

  • actions/checkout v5 -> v7
  • actions/setup-node v6 -> v7

Neither major affects this workflow. setup-node v7 is an ESM and dependency migration with cache behaviour unchanged; checkout v6/v7 only change credential storage and fork checkout under pull_request_target / workflow_run, which this workflow does not use.

On timing: this PR's own run was a cache miss that populated the cache, and that entry is scoped to refs/pull/207/merge, so it is discarded when the PR closes. The durable win starts after this lands and a master build populates the base-branch cache, which later PRs can then read. Expect it to stay modest either way — most of the ~30s run is the Astro build, not npm ci.

🤖 Generated with Claude Code

Add `cache: npm` to actions/setup-node so `npm ci` restores the
dependency tree from cache instead of re-downloading it every run.
The cache key defaults to package-lock.json at the repo root, and
each matrix leg caches separately since the key includes the Node
version.

Also bump actions/checkout v5 -> v7 and actions/setup-node v6 -> v7.
Neither major affects this workflow: setup-node v7 is an ESM and
dependency migration with `cache` unchanged, and checkout v6/v7 only
change credential storage and fork checkout under pull_request_target
and workflow_run, which this workflow does not use.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@magnus-madsen
magnus-madsen merged commit a81c5cc into master Aug 8, 2026
2 checks passed
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.

1 participant