Skip to content
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

feat(cache): change key to match actions/cache documentation #323

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat(cache): change key to match actions/cache documentation #323

wants to merge 1 commit into from

Conversation

mmorel-35
Copy link

This PR change the cache key construction to fit those examples. It also add the use of restoreKeys and a more verbose log when retrieving fails.

Signed-off-by: Matthieu MOREL <mmorel-35@users.noreply.github.com>
nigelzor added a commit to thrivehealth/setup-node that referenced this pull request Dec 8, 2021
it's a lot faster to start from a 90% correct cache than an empty one

re: actions#286
re: actions#323
re: actions#328
@oxc
Copy link

oxc commented Feb 1, 2022

Does it make sense to fallback on a shared prefix without the package manager? They probably even use different cache directories.

@ThisIsMissEm
Copy link

Does it make sense to fallback on a shared prefix without the package manager? They probably even use different cache directories.

I would agree, falling back to a prefix without package manager probably isn't useful — they definitely use separate cache paths.

@ThisIsMissEm ThisIsMissEm mentioned this pull request Mar 2, 2022
3 tasks
@belgattitude
Copy link

Hey just saw a link to this PR. I'd like to mention few discoveries I did recently

  • Yarn 3+ cache is automatically pruned when deps changes (it does not grow over time on the github cache).
  • Yarn 3+ cache is OS/arch independent (no need to prefix with OS)
  • Pnpm 7 is not pruned automatically,. There's a specific command https://pnpm.io/cli/store#prune. It's sometimes buggy.

You can see two examples based on @action/cache:

It might be helpful.

@oxc
Copy link

oxc commented Oct 11, 2022

  • Yarn 3+ cache is automatically pruned when deps changes (it does not grow over time on the github cache).

I believe this is only true if you're not using the global cache in your project. From $(yarn config get cacheFolder) alone there is no way to distinguish the two.
See also https://yarnpkg.com/features/offline-cache#sharing-the-cache

@belgattitude
Copy link

True, if you look at the yarn gist you'll see that on ci the global cache is disabled YARN_ENABLE_GLOBAL_CACHE=false through an env. That makes it work independently of config.

@oxc
Copy link

oxc commented Oct 11, 2022

True, if you look at the yarn gist you'll see that on ci the global cache is disabled YARN_ENABLE_GLOBAL_CACHE=false through an env. That makes it work independently of config.

I see. For the record, I would hate it if the node action overrode my yarn config 😄

@voxpelli
Copy link

Added an up to date evolution of this PR over here: #702

falling back to a prefix without package manager probably isn't useful

That PR fixes this ☝️

npm will not remove data by itself: the cache will grow as new packages are installed.

And it also fixes the infinitely growing cache problem that comes with this ☝️

nigelzor added a commit to thrivehealth/setup-node that referenced this pull request Feb 28, 2023
it's a lot faster to start from a 90% correct cache than an empty one

re: actions#286
re: actions#323
re: actions#328
deining pushed a commit to deining/setup-node that referenced this pull request Nov 9, 2023
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.31.1 to 0.32.0.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](vercel/ncc@0.31.1...0.32.0)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants