Replies: 1 comment 1 reply
-
I probably have this question with yarn v3 too - admittedly I haven't tried adding One would have hoped and expected that there would be a single maintained GitHub Action which takes care of all these details without individual developers having to waste time on it. I guess the intention used to be that https://github.com/marketplace/actions/yarn-install-cache would be that action, but then it got deprecated in favour of Furthermore, https://yarnpkg.com/features/caching#github-actions says:
Surely this affects an extremely large group of devs who use yarn and GitHub Actions, so I really hope this can be addressed sooner rather than later. |
Beta Was this translation helpful? Give feedback.
-
We're using the node_modules linker with yarn v4 in a monorepo, and we want to cache as much as possible across builds in CI to minimise unnecessary work. Our current strategy is to cache and restore the following:
node_modules
directory.yarn/cache
.yarn/install-state.gz
(after reading this recent comment)Prior to adding
.yarn/install-state.gz
to the cache, we were getting slow link times + YN0007 errors since yarn couldn't tell that some binaries had already been built. Now that we cache that file, our YN0007's have turned into YN0008 warnings, i.e. "must be rebuilt because its dependency tree changed" warnings for all of our build scripts.Beyond seeing YN0008, it's hard to tell exactly which "dependencies" have changed. Possible culprits based on my current research:
There's probably more detail I can go into, but at its core: what is the optimal way to safely cache and restore yarn's state in CI, assuming:
Any help or pointers towards the algorithm yarn uses to invalidate installs would be greatly useful here - thanks!
Beta Was this translation helpful? Give feedback.
All reactions