-
-
Notifications
You must be signed in to change notification settings - Fork 730
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
Cache yarn global package data in CI #12581
Conversation
I don't know what this actually does, because it doesn't install the dependencies, that still needs to happen next. But surely any cache is a good thing?
I checked and this saves about 6 seconds, so I think it's worth adding. Before (last build on master) - 19sFirst time - 22s
Subsequent - 13sRun actions/setup-node@v3:
https://github.com/dacook/openfoodnetwork/actions/runs/9558250039/job/26347954244 |
Presumably it caches the downloaded dependencies, which are then installed from the cache, see : |
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.
Nice find !
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.
Nice!
I set out to cache the node_modules folder, but came across this easy fix first: https://github.com/actions/setup-node?tab=readme-ov-file#caching-global-packages-data
I don't know what this actually does, because it doesn't install the dependencies, that still needs to happen next.
But it saves about 6 seconds (see results below), so I think it's worth adding.
What should we test?
Next up
We could probably save a further 6 seconds by caching node_modules. This guide looks straightforward. But why is this not built-in to an official action??
https://github.com/actions/cache/blob/main/examples.md#node---yarn