Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use built-in caching from actions/setup-node GHA #6541

Merged
merged 2 commits into from Aug 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
92 changes: 7 additions & 85 deletions .github/workflows/build-test-measure.yml
Expand Up @@ -90,18 +90,7 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}

- name: Get npm cache directory
id: npm-cache
run: echo "::set-output name=dir::$(npm config get cache)"

- name: Configure npm cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
cache: npm

- name: Install Node dependencies
run: npm ci
Expand Down Expand Up @@ -130,18 +119,7 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}

- name: Get npm cache directory
id: npm-cache
run: echo "::set-output name=dir::$(npm config get cache)"

- name: Configure npm cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
cache: npm

- name: Install Node dependencies
run: npm ci
Expand Down Expand Up @@ -275,18 +253,7 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}

- name: Get npm cache directory
id: npm-cache
run: echo "::set-output name=dir::$(npm config get cache)"

- name: Configure npm cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
cache: npm

- name: Setup Jest cache
uses: actions/cache@v2
Expand Down Expand Up @@ -334,6 +301,7 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}
cache: npm

- name: Get Composer Cache Directory
id: composer-cache
Expand All @@ -347,18 +315,6 @@ jobs:
restore-keys: |
${{ runner.os }}-composer-

- name: Get npm cache directory
id: npm-cache
run: echo "::set-output name=dir::$(npm config get cache)"

- name: Configure npm cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-

- name: Install Node dependencies
run: npm ci
env:
Expand Down Expand Up @@ -477,6 +433,7 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}
cache: npm

- name: Get Composer Cache Directory
id: composer-cache
Expand All @@ -493,18 +450,6 @@ jobs:
- name: Install Composer dependencies
run: composer install --prefer-dist --ignore-platform-reqs --no-progress --no-interaction

- name: Get npm cache directory
id: npm-cache
run: echo "::set-output name=dir::$(npm config get cache)"

- name: Configure npm cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-

- name: Install Node dependencies
run: npm ci
env:
Expand Down Expand Up @@ -641,6 +586,7 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}
cache: npm

- name: Get Composer Cache Directory
id: composer-cache
Expand All @@ -657,18 +603,6 @@ jobs:
- name: Install Composer dependencies
run: composer install --prefer-dist --ignore-platform-reqs --no-progress --no-interaction

- name: Get npm cache directory
id: npm-cache
run: echo "::set-output name=dir::$(npm config get cache)"

- name: Configure npm cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-

- name: Install Node dependencies
run: npm ci
env:
Expand Down Expand Up @@ -756,6 +690,7 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}
cache: npm

- name: Get Composer Cache Directory
id: composer-cache
Expand All @@ -775,19 +710,6 @@ jobs:
# `sabberworm/php-css-parser` dependency.
run: composer install --prefer-dist --optimize-autoloader

- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"

- name: Configure npm cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-

- name: Install Node dependencies
run: npm ci
env:
Expand Down
13 changes: 1 addition & 12 deletions .github/workflows/gutenberg-packages-update.yml
Expand Up @@ -102,18 +102,7 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}

- name: Get npm cache directory
id: npm-cache
run: echo "::set-output name=dir::$(npm config get cache)"

- name: Configure npm cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
cache: npm

- name: Configure git user
run: |
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
@@ -1 +1 @@
15
lts/*