Make WordPress Core


Ignore:
Timestamp:
07/06/2021 01:12:13 PM (3 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/end-to-end-tests.yml

    r50930 r51341  
    3838  # - Logs debug information about the runner container.
    3939  # - Installs NodeJS 14.
    40   # - Sets up caching for NPM.
    4140  # _ Installs NPM dependencies using install-changed to hash the `package.json` file.
    4241  # - Builds WordPress to run from the `build` directory.
     
    7473
    7574      - name: Install NodeJS
    76         uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5
     75        uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f # v2.2.2
    7776        with:
    7877          node-version: 14
    79 
    80       - name: Cache NodeJS modules
    81         uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4
    82         env:
    83           cache-name: cache-node-modules
    84         with:
    85           # npm cache files are stored in `~/.npm` on Linux/macOS
    86           path: ~/.npm
    87           key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
     78          cache: npm
    8879
    8980      - name: Install Dependencies
Note: See TracChangeset for help on using the changeset viewer.