WordPress.org

Make WordPress Core

Opened 4 months ago

Closed 4 months ago

#53584 closed enhancement (fixed)

Update `actions/setup-node` and use the builtin cache feature

Reported by: desrosj Owned by: desrosj
Milestone: 5.9 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch
Focuses: Cc:

Description

As of version 2.2.2, caching for NPM dependencies is now built into the action/setup-action action. This simplifies workflows utilizing NPM by eliminating the need for a separate step using actions/cache.

The cache key used will be ${{ runner.os }}-npm-${{ hashFiles('') }}, which is the same cache as recommended in the actions/cache documentation.

See actions/setup-node#272 or https://github.blog/changelog/2021-07-02-github-actions-setup-node-now-supports-dependency-caching/ for more information.

Change History (2)

#2 @desrosj
4 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 51341:

Build/Test Tools: Use caching built into actions/setup-node.

This updates the actions/setup-node action to version 2.2.2 and takes advantage of the cache feature now built in. This removes the need for an additional step using actions/cache to cache NPM dependencies.

The cache key used will be ${{ runner.os }}-npm-${{ hashFiles('') }}, which matches the recommendation in the actions/cache documentation and the key currently in use in the WordPress workflows.

Props gziolo.
Fixes #53584.

Note: See TracTickets for help on using tickets.