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

Enable caching of npm install/npm ci for setup-node action #1457

Open
wants to merge 2 commits into
base: remove-unneeded-ref-hardcoding
Choose a base branch
from

Conversation

jeffwidman
Copy link
Member

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/

I'm copying the setup of one of these actions to another repo, and the hardcoding of ref surprised me... these should be the same as the defaault behavior. I checked with Barry who originally committed these files, and he didn't remember why... possibly he'd hardcoded them when testing the action and forgot to remove them.

So let's pull them out to remove confusion.
@Copilot Copilot bot review requested due to automatic review settings April 11, 2025 23:00
@jeffwidman jeffwidman requested a review from a team as a code owner April 11, 2025 23:00
Copy link

@Copilot Copilot AI left a 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

@jeffwidman jeffwidman force-pushed the remove-unneeded-ref-hardcoding branch from 21e2530 to d1a760e Compare April 11, 2025 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant