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/coding-standards.yml

    r50930 r51341  
    103103  # - Logs debug information about the runner container.
    104104  # - Installs NodeJS 14.
    105   # - Sets up caching for NPM.
    106105  # - Logs updated debug information.
    107106  # _ Installs NPM dependencies using install-changed to hash the `package.json` file.
     
    127126
    128127      - name: Install NodeJS
    129         uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
     128        uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f # v2.2.2
    130129        with:
    131130          node-version: 14
    132 
    133       - name: Cache NodeJS modules
    134         uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
    135         env:
    136           cache-name: cache-node-modules
    137         with:
    138           # npm cache files are stored in `~/.npm` on Linux/macOS
    139           path: ~/.npm
    140           key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
     131          cache: npm
    141132
    142133      - name: Log debug information
Note: See TracChangeset for help on using the changeset viewer.