-
Notifications
You must be signed in to change notification settings - Fork 50
Enable caching of npm install
/npm ci
for setup-node
action
#1457
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
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.
Pull Request Overview
This PR enables caching for npm dependencies in GitHub Actions workflows by leveraging the setup-node action's new caching support.
- Enables caching for npm commands by adding "cache: 'npm'" to the setup-node action.
- Simplifies workflow steps by removing the redundant "name: Setup Node.js" fields.
- Applies changes consistently across multiple workflow configuration files.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
.github/workflows/test.yml | Updated setup-node step to cache npm dependencies |
.github/workflows/integration-test.yml | Added caching for npm in the setup-node step |
.github/workflows/dependabot-build.yml | Enabled npm caching and removed explicit step name |
.github/workflows/check-dist.yml | Applied caching configuration for npm dependencies |
Comments suppressed due to low confidence (4)
.github/workflows/test.yml:16
- [nitpick] Consider adding an explicit step name (e.g., 'Setup Node.js with caching') to improve clarity in workflow logs.
- uses: actions/setup-node@v4
.github/workflows/integration-test.yml:20
- [nitpick] Adding a descriptive step name for the setup-node action can enhance the readability of the workflow logs.
- uses: actions/setup-node@v4
.github/workflows/dependabot-build.yml:37
- [nitpick] Consider reintroducing a step name for the setup-node action to make the workflow easier to navigate in logs.
- uses: actions/setup-node@v4
.github/workflows/check-dist.yml:17
- [nitpick] It might be beneficial to add a step name for clarity in the workflow log outputs, such as 'Setup Node.js with cache enabled'.
- uses: actions/setup-node@v4
d1a760e
to
787f5ec
Compare
The `setup-node` action now supports caching the results of `npm install`/`npm ci`: https://github.blog/changelog/2021-07-02-github-actions-setup-node-now-supports-dependency-caching/
bc54419
to
d3b7519
Compare
@@ -32,16 +32,14 @@ jobs: | |||
# Check out using a PAT so any pushed changes will trigger checkruns | |||
- uses: actions/checkout@v4 | |||
with: | |||
ref: ${{ github.event.pull_request.head.ref }} |
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.
This was a leftover that I'd forgotten to remove as part of:
So removed it here.
The
setup-node
action now supports caching the results ofnpm install
/npm ci
:https://github.blog/changelog/2021-07-02-github-actions-setup-node-now-supports-dependency-caching/