Repository navigation
chore: cache npm deps in CI and update actions to v7 - #207
Merged
Merged
Conversation
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>
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.
Adds
cache: npmtoactions/setup-nodesonpm cirestores package tarballs from cache rather than re-downloading them on every run. The cache key defaults topackage-lock.jsonat 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/checkoutv5 -> v7actions/setup-nodev6 -> v7Neither major affects this workflow. setup-node v7 is an ESM and dependency migration with
cachebehaviour unchanged; checkout v6/v7 only change credential storage and fork checkout underpull_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, notnpm ci.🤖 Generated with Claude Code