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

Use @action/cache to cache where possible #27

Open
rwjblue opened this issue May 27, 2020 · 9 comments · May be fixed by #137
Open

Use @action/cache to cache where possible #27

rwjblue opened this issue May 27, 2020 · 9 comments · May be fixed by #137
Labels
enhancement New feature or request

Comments

@rwjblue
Copy link
Collaborator

rwjblue commented May 27, 2020

There are a few scenarios where we could take advantage of the newly published caching package:

  • To download volta itself (though this should already be cached)
  • To download a tool based on the provided explicit node/yarn version
  • When using this action without manually specifying node-version or yarn-version. We should be able to cache based on the volta key in package.json, and avoid having to download node/volta/etc if nothing has changed.
  • When using a SemVer range matcher like node-version: 12.x. This is a bit trickier than the prior scenario since it is not obvious how to comprise the cache key so that you do get a newer versions within your allowed range "periodically". Ideally we do not need to duplicate the logic in Volta itself for determining the node versions.
@rwjblue rwjblue added the enhancement New feature or request label May 27, 2020
@avarun42
Copy link

When using this action without manually specifying node-version or yarn-version. We should be able to cache based on the volta key in package.json, and avoid having to download node/volta/etc if nothing has changed.

Would be great to have this feature implemented

@just-Bri
Copy link

just-Bri commented Oct 12, 2022

Was wondering if this request includes caching of yarn packages.
That's something I was doing with the setup-node action but it seems to be missing here.

Not a huge problem but would be nice to see yarn/npm/pnpm package caching as well.

@rwjblue
Copy link
Collaborator Author

rwjblue commented Dec 16, 2022

@just-Bri - Yes, I was thinking that would be included when we do this work...

@just-Bri
Copy link

@just-Bri - Yes, I was thinking that would be included when we do this work...

I figured as much but wanted to call it out directly to make sure. The issue doesn't specify caching of installed node packages, I was afraid it was referring to just Volta/node/npm/yarn/pnpm and not the packages installed installed via an npm i

@jasikpark
Copy link

Anyone mind mentoring me on implementing this feature? I use setup-node everywhere, but I wish it would consume my volta config.. would be nice to enable similar caching setup in this action && get my node and npm versions synced perfectly 😁

@jswhisperer
Copy link

jswhisperer commented Jun 9, 2023

To confirm does this action at least cache the node version it downloads as per the README
When it says optionanlly is that the default behavior and if not how do we toggle this option to yes (I don't see in the API docs).

image

Would really appreciate feature parity with setup-node and cache yarn/npm etc packages if possible.

cheers and thanks for the action so far!

@jswhisperer
Copy link

jswhisperer commented Jun 16, 2023

you can use the pinned volta version from package.json with setup-node action

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
  with:
    node-version-file: 'package.json'
    cache: 'yarn'

Or you can role your own with volta action and the cache action

@cgrabmann
Copy link

Would really be nice if the action would just cache and restore the downloaded tools, since I ran into a situation multiple times now, where the Node Download timed out. It would not need to be downloaded again if it would be cached since the version does not change most of the time anyway.

@jswhisperer
Copy link

Would really be nice if the action would just cache and restore the downloaded tools, since I ran into a situation multiple times now, where the Node Download timed out. It would not need to be downloaded again if it would be cached since the version does not change most of the time anyway.

you might just want a GH / NPM token to prevent timeouts @cgrabmann

  - name: Setup node
    uses: actions/setup-node@v3
    with:
      cache: 'yarn'
      token: '${{ secrets.YOUR_GH_TOKEN }}'
      node-version-file: 'package.json'

cgrabmann added a commit to cloudflightio/volta-cli-action that referenced this issue Oct 4, 2023
cgrabmann added a commit to cloudflightio/volta-cli-action that referenced this issue Oct 4, 2023
cgrabmann added a commit to cloudflightio/volta-cli-action that referenced this issue Oct 4, 2023
cgrabmann added a commit to cloudflightio/volta-cli-action that referenced this issue Oct 4, 2023
cgrabmann added a commit to cloudflightio/volta-cli-action that referenced this issue Oct 4, 2023
cgrabmann added a commit to cloudflightio/volta-cli-action that referenced this issue Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
6 participants