mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-03 22:27:04 +00:00
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@51341 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -43,7 +43,6 @@ jobs:
|
||||
# - Set environment variables.
|
||||
# - Sets up the environment variables needed for testing with memcached (if desired).
|
||||
# - Installs NodeJS 14.
|
||||
# - Sets up caching for NPM.
|
||||
# - Installs NPM dependencies
|
||||
# - Configures caching for Composer.
|
||||
# - Installs Composer dependencies (if desired).
|
||||
@@ -114,18 +113,10 @@ jobs:
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
||||
|
||||
- name: Install NodeJS
|
||||
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
|
||||
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f # v2.2.2
|
||||
with:
|
||||
node-version: 14
|
||||
|
||||
- name: Use cached Node modules
|
||||
uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
|
||||
env:
|
||||
cache-name: cache-node-modules
|
||||
with:
|
||||
# npm cache files are stored in `~/.npm` on Linux/macOS
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
|
||||
cache: npm
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm ci
|
||||
|
||||
Reference in New Issue
Block a user