Make WordPress Core


Ignore:
Timestamp:
07/06/2021 01:12:13 PM (5 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/test-coverage.yml

    r50595 r51341  
    3535  # - Logs debug information about the runner container.
    3636  # - Installs NodeJS 14.
    37   # - Sets up caching for NPM.
    3837  # _ Installs NPM dependencies using install-changed to hash the `package.json` file.
    3938  # - Logs Docker debug information (about the Docker installation within the runner).
    … …  
    8079
    8180      - name: Install NodeJS
    82         uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
     81        uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f # v2.2.2
    8382        with:
    8483          node-version: 14
    85 
    86       - name: Cache NodeJS modules
    87         uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
    88         env:
    89           cache-name: cache-node-modules
    90         with:
    91           # npm cache files are stored in `~/.npm` on Linux/macOS
    92           path: ~/.npm
    93           key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
     84          cache: npm
    9485
    9586      - name: Install Dependencies
Note: See TracChangeset for help on using the changeset viewer.