-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Question - How to cache builds on GHA? #2874
Description
Hello,
This is not an issue or bug report for node-gyp, this is a tired dev asking for help.
I'm trying to speed up our pipelines running on github actions. Currently yarn install takes about 1 minute, in a huge mono-repo. I'm already using actions/cache and checked actions/setup-node with the cache: yarn option as well, but couldn't bring down the yarn install time.
From what I can tell, the biggest time cost comes from 2 dependencies which run node-gyp every time. On CI, the Link step takes 1 minute. Locally, it's ~1s and node-gyp doesn't run (again)
I tried caching the builds and the global cache:
~/.cache/node-gyp
# Explicit caching of the affected packages
node_modules/cpu-features/build
node_modules/unix-dgram/build
I confirmed the build cache is correctly saved and restored, but node-gyp still runs.
Do you have any advice how I can skip running node-gyp on CI?
- Node Version: [email protected], [email protected], [email protected], [email protected]
- Platform: Ubuntu-latest on Github Actions
- Compiler:
- Module:
Thanks for your time and your great project!