Skip to content

Commit

Permalink
Use the easy npm caching now built into actions/setup-node (github#20316
Browse files Browse the repository at this point in the history
)
  • Loading branch information
JamesMGreene authored Jul 13, 2021
1 parent 6a23589 commit 149864b
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 157 deletions.
3 changes: 1 addition & 2 deletions .github/allowed-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
// can be added it this list.

module.exports = [
"actions/cache@0781355a23dac32fd3bac414512f4b903437991a", // v2.1.3
"actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f", // v2.3.4
"actions/github-script@2b34a689ec86a68d8ab9478298f91d5401337b7d", // v4.0.2
"actions/labeler@5f867a63be70efff62b767459b009290364495eb", // v2.2.0
"actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e", // v2.1.4
"actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f", // v2.2.0
"actions/setup-python@dc73133d4da04e56a135ae2246682783cc7c7cb6", // v2.2.2
"actions/stale@9d6f46564a515a9ea11e7762ab3957ee58ca50da", // v3.0.16
"alex-page/github-project-automation-plus@fdb7991b72040d611e1123d2b75ff10eda9372c9",
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/browser-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,10 @@ jobs:
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f

- name: Setup Node
uses: actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f
with:
node-version: 16.x

- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: Cache node modules
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: npm

- name: Install dependencies
run: npm ci --include=optional
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/dry-run-sync-algolia-search-indices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,10 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- uses: actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e
- uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f
with:
node-version: 16.x
- name: cache node modules
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: npm
- name: Install dependencies
run: npm ci
- name: Run build scripts
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/js-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,10 @@ jobs:
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f

- name: Setup node
uses: actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f
with:
node-version: 16.x

- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: Cache node modules
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: npm

- name: Install dependencies
run: npm ci
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/link-check-dotcom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ jobs:
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f

- name: Setup node
uses: actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f
with:
node-version: 16.x
cache: npm

- name: Install
run: npm ci
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/link-check-ghae.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ jobs:
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f

- name: Setup node
uses: actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f
with:
node-version: 16.x
cache: npm

- name: Install
run: npm ci
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/link-check-ghes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ jobs:
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f

- name: Setup node
uses: actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f
with:
node-version: 16.x
cache: npm

- name: Install
run: npm ci
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/pa11y.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,10 @@ jobs:
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f

- name: Setup Node
uses: actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f
with:
node-version: 16.x

- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: Cache node modules
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: npm

- name: Install dependencies
run: npm ci --include=optional
Expand Down
34 changes: 4 additions & 30 deletions .github/workflows/staging-deploy-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,10 @@ jobs:

- if: ${{ github.event_name == 'workflow_dispatch' }}
name: Setup node
uses: actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f
with:
node-version: 16.x

- if: ${{ github.event_name == 'workflow_dispatch' }}
name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- if: ${{ github.event_name == 'workflow_dispatch' }}
name: Cache node modules
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: npm

- if: ${{ github.event_name == 'workflow_dispatch' }}
name: Install dependencies
Expand Down Expand Up @@ -111,22 +97,10 @@ jobs:
persist-credentials: 'false'

- name: Setup node
uses: actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f
with:
node-version: 16.x

- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: Cache node modules
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: npm

- name: Install dependencies
run: npm ci
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/staging-undeploy-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,10 @@ jobs:
persist-credentials: 'false'

- name: Setup node
uses: actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f
with:
node-version: 16.x

- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: Cache node modules
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: npm

- name: Install dependencies
run: npm ci
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/sync-algolia-search-indices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,10 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- uses: actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e
- uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f
with:
node-version: 16.x
- name: cache node modules
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: npm
- name: Install dependencies
run: npm ci
- name: Run build scripts
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/sync-single-english-algolia-index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,10 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- uses: actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e
- uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f
with:
node-version: 16.x
- name: cache node modules
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: npm
- name: npm ci
run: npm ci
- name: Get version from Algolia label if present; only continue if the label is found.
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,10 @@ jobs:
persist-credentials: 'false'

- name: Setup node
uses: actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f
with:
node-version: 16.x

- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: Cache node modules
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: npm

- name: Install dependencies
run: npm ci
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,10 @@ jobs:
persist-credentials: 'false'

- name: Setup node
uses: actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f
with:
node-version: 16.x

- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: Cache node modules
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: npm

- name: Install dependencies
run: npm ci
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/yml-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,10 @@ jobs:
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f

- name: Setup node
uses: actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e
uses: actions/setup-node@38d90ce44d5275ad62cc48384b3d8a58c500bb5f
with:
node-version: 16.x

- name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: Cache node modules
uses: actions/cache@0781355a23dac32fd3bac414512f4b903437991a
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
cache: npm

- name: Install dependencies
run: npm ci
Expand Down

0 comments on commit 149864b

Please sign in to comment.