Skip to content

Commit

Permalink
Workflows: Use built-in cache support in actions/setup-node (#8189)
Browse files Browse the repository at this point in the history
  • Loading branch information
spacedmonkey committed Jul 5, 2021
1 parent 270cc17 commit 7ed6688
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 193 deletions.
32 changes: 4 additions & 28 deletions .github/workflows/build-and-deploy.yml
Expand Up @@ -58,20 +58,8 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2.2.0
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Cache node modules
uses: pat-s/always-upload-cache@v2.1.5
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
env:
cache-name: cache-node-modules
node-version: ${{ steps.nvm.outputs.NVMRC }}
cache: npm

- name: Bundle size check
uses: preactjs/compressed-size-action@v2
Expand All @@ -98,20 +86,8 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2.2.0
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Cache node modules
uses: pat-s/always-upload-cache@v2.1.5
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
env:
cache-name: cache-node-modules
node-version: ${{ steps.nvm.outputs.NVMRC }}
cache: npm

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/deploy-storybook.yml
Expand Up @@ -38,20 +38,8 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2.2.0
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Cache node modules
uses: pat-s/always-upload-cache@v2.1.5
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
env:
cache-name: cache-node-modules
node-version: ${{ steps.nvm.outputs.NVMRC }}
cache: npm

- name: Install dependencies
run: npm ci
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/lint-css-js-md.yml
Expand Up @@ -56,20 +56,8 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2.2.0
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Cache node modules
uses: pat-s/always-upload-cache@v2.1.5
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
env:
cache-name: cache-node-modules
node-version: ${{ steps.nvm.outputs.NVMRC }}
cache: npm

- name: Install dependencies
run: npm ci
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/lint-i18n.yml
Expand Up @@ -56,20 +56,8 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2.2.0
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Cache node modules
uses: pat-s/always-upload-cache@v2.1.3
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
env:
cache-name: cache-node-modules
node-version: ${{ steps.nvm.outputs.NVMRC }}
cache: npm

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
48 changes: 6 additions & 42 deletions .github/workflows/plugin-release.yml
Expand Up @@ -201,20 +201,8 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2.2.0
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Cache node modules
uses: pat-s/always-upload-cache@v2.1.5
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
env:
cache-name: cache-node-modules
node-version: ${{ steps.nvm.outputs.NVMRC }}
cache: npm

- name: Install dependencies
run: npm ci
Expand Down Expand Up @@ -302,20 +290,8 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2.2.0
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Cache node modules
uses: pat-s/always-upload-cache@v2.1.5
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
env:
cache-name: cache-node-modules
node-version: ${{ steps.nvm.outputs.NVMRC }}
cache: npm

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down Expand Up @@ -524,20 +500,8 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2.2.0
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Cache node modules
uses: pat-s/always-upload-cache@v2.1.5
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
env:
cache-name: cache-node-modules
node-version: ${{ steps.nvm.outputs.NVMRC }}
cache: npm

- name: Install dependencies
run: npm ci
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/tests-e2e.yml
Expand Up @@ -73,20 +73,8 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2.2.0
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Cache node modules
uses: pat-s/always-upload-cache@v2.1.5
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
env:
cache-name: cache-node-modules
node-version: ${{ steps.nvm.outputs.NVMRC }}
cache: npm

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
14 changes: 1 addition & 13 deletions .github/workflows/tests-karma-dashboard.yml
Expand Up @@ -53,19 +53,7 @@ jobs:
uses: actions/setup-node@v2.2.0
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}

- name: Cache node modules
uses: pat-s/always-upload-cache@v2.1.5
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
env:
cache-name: cache-node-modules
cache: npm

# TODO: Remove need for `npm install puppeteer`.
- name: Install dependencies
Expand Down
14 changes: 1 addition & 13 deletions .github/workflows/tests-karma-editor.yml
Expand Up @@ -58,19 +58,7 @@ jobs:
uses: actions/setup-node@v2.2.0
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}

- name: Cache node modules
uses: pat-s/always-upload-cache@v2.1.5
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
env:
cache-name: cache-node-modules
cache: npm

# TODO: Remove need for `npm install puppeteer`.
- name: Install dependencies
Expand Down
14 changes: 1 addition & 13 deletions .github/workflows/tests-unit-js.yml
Expand Up @@ -47,19 +47,7 @@ jobs:
uses: actions/setup-node@v2.2.0
with:
node-version: ${{ steps.nvm.outputs.NVMRC }}

- name: Cache node modules
uses: pat-s/always-upload-cache@v2.1.5
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
env:
cache-name: cache-node-modules
cache: npm

- name: Setup Jest cache
uses: actions/cache@v2.1.6
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/update-google-fonts.yml
Expand Up @@ -21,20 +21,8 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2.2.0
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Cache node modules
uses: pat-s/always-upload-cache@v2.1.5
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
env:
cache-name: cache-node-modules
node-version: ${{ steps.nvm.outputs.NVMRC }}
cache: npm

- name: Install dependencies
run: npm ci
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/update-templates.yml
Expand Up @@ -21,20 +21,8 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2.2.0
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'

- name: Cache node modules
uses: pat-s/always-upload-cache@v2.1.5
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
env:
cache-name: cache-node-modules
node-version: ${{ steps.nvm.outputs.NVMRC }}
cache: npm

- name: Install dependencies
run: npm ci
Expand Down

0 comments on commit 7ed6688

Please sign in to comment.