-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(repair broken cached-checkout-install step) #1454
Conversation
@@ -14,16 +14,14 @@ runs: | |||
env: | |||
cache-name: cache-node-modules | |||
with: | |||
path: ~/.npm | |||
path: ./node_modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fyi https://github.com/actions/cache/blob/main/examples.md#node---npm
Note It is not recommended to cache node_modules, as it can break across Node versions and won't work with npm ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw that; two thoughts:
- to avoid this breaking across Node versions, we could hash the node version and add it to the key
- npm ci only runs on a cache miss, so node_modules won't exist in that case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the explanation. I checked the build time for all previous pull requests and didn't see any significant improvement. Am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's a slight speedup for pull requests, but PRs only trigger the first 3 steps of the CI flow; every other step also uses cached-checkout-install
, so full deployments should be faster by a few minutes, maybe 3 or so
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Quality Gate passedIssues Measures |
This PR fixes a bug where
npm ci
was being called every timecached-checkout-install
was being called, regardless ifnode_modules
was found in the cache or not. This should reduce our pipeline times by a considerable amount :)