Make WordPress Core


Ignore:
Timestamp:
07/06/2021 01:12:13 PM (4 years ago)
Author:
desrosj
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/.github/workflows/phpunit-tests.yml

    r50930 r51341  
    4444  # - Sets up the environment variables needed for testing with memcached (if desired).
    4545  # - Installs NodeJS 14.
    46   # - Sets up caching for NPM.
    4746  # - Installs NPM dependencies
    4847  # - Configures caching for Composer.
     
    115114
    116115      - name: Install NodeJS
    117         uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
     116        uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f # v2.2.2
    118117        with:
    119118          node-version: 14
    120 
    121       - name: Use cached Node modules
    122         uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
    123         env:
    124           cache-name: cache-node-modules
    125         with:
    126           # npm cache files are stored in `~/.npm` on Linux/macOS
    127           path: ~/.npm
    128           key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
     119          cache: npm
    129120
    130121      - name: Install Dependencies
Note: See TracChangeset for help on using the changeset viewer.