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 the new granular cache actions #654

Closed
wmertens opened this issue Dec 28, 2022 · 4 comments
Closed

Use the new granular cache actions #654

wmertens opened this issue Dec 28, 2022 · 4 comments
Labels
feature request New feature or request to improve the current logic

Comments

@wmertens
Copy link

wmertens commented Dec 28, 2022

Description:

Actions/cache now supports choosing when to save and restore.

See actions/cache#1020 for a description.

So, setup-node can run the save automatically after packages install.

For that, the install command has to be called by setup-node as well.
It can be passed as an option, it can have a default (npm ci), and with corepack support #546 the defaults can be sensible, per package manager type.

So then, most devs will just use this action with flags cache and install and that's all they need to do.

Justification:

  • more efficient runs
  • less boilerplate to use

Are you willing to submit a PR?

Maybe, but not now

@wmertens wmertens added feature request New feature or request to improve the current logic needs triage labels Dec 28, 2022
@marko-zivic-93
Copy link
Contributor

Hello @wmertens
Thank you for your feature request. We will investigate it and come back you you :)

@dmitry-shibanov
Copy link
Contributor

Hello @wmertens. I think it should not be implemented in scope of actions/setup-node because according to the ADR the cache should the majority of use cases. If you need more flexible solution it is better to use actions/cache.

For now I'm going to close the issue.

@dmitry-shibanov dmitry-shibanov closed this as not planned Won't fix, can't repro, duplicate, stale Jan 10, 2023
@wmertens
Copy link
Author

Hmm, wouldn't this functionality be 95% of use cases? Most of the time, you want your package manager of choice to run the install, and you want this to happen as fast as possible, and so you want caching?

@dmitry-shibanov
Copy link
Contributor

The setup-node action saves global cache directory for npm, yarn and pnpm that is why I think it does rely on the place where the cache will be saved. Moreover, the main purpose of the action is to setup Nodejs for images and adding extra logic to execute npm ci or npm i will be an overload for the action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request to improve the current logic
Projects
None yet
Development

No branches or pull requests

5 participants
@wmertens @dmitry-shibanov @marko-zivic-93 and others