-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add optional node and npm dependency caching #185
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! 🙌 I think this looks good and can be merged, but would love an opinion from @jackw, as he was looking into adding a shared action to detect the package manager being used in a plugin's repo.
Once that's introduced, we can make the two arguments optional and, when they're not provided, the package manager will be auto-detected. However we probably still need an input to disable caching if necessary.
I think we can merge this for now, but we may have to change/deprecate some inputs in the future. @jackw wdyt? maybe we should wait until we can auto-detect the package manager?
|
fixes #194 |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | ||
| with: | ||
| node-version: "${{ inputs.node-version }}" | ||
| cache: "${{ inputs.node-cache }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we know what happens when those inputs are empty strings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty string is the default so it should work fine.
.github/workflows/ci.yml
Outdated
| node-cache: | ||
| description: Used to specify a package manager for caching in the default directory. Supported values npm, yarn, pnpm (https://github.com/actions/setup-node#caching-global-packages-data) | ||
| type: string | ||
| required: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed we already have a package-manager input so we could just use that...
817e168 to
2b40c64
Compare
|
I've updated this to remove the I imagine we use @jackw's PR to automatically populate a sensible default here but the underlying |
2b40c64 to
302e5ea
Compare
Similar to #181 but for node and npm. This has to be manually enabled because we don't know the user's package manager.
302e5ea to
4a60108
Compare
Similar to #181 but for node and npm. This has to be manually enabled
because we don't know the user's package manager.