Improve caching for Yarn based on https://github.com/actions/cache/blob/main/examples.md
This commit is contained in:
parent
2d877c8557
commit
64e20a14a7
3 changed files with 49 additions and 26 deletions
43
.github/workflows/js.yml
vendored
43
.github/workflows/js.yml
vendored
|
@ -19,13 +19,17 @@ jobs:
|
|||
- uses: actions/setup-node@v1.4.2
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- uses: actions/cache@v1
|
||||
name: Use Node package cache
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
|
||||
- uses: actions/cache@v2
|
||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||
with:
|
||||
path: node_modules
|
||||
key: bundle-use-node-js-${{ matrix.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock', '**/package.json') }}
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
bundle-use-node-js-${{ matrix.os }}-${{ matrix.node }}-
|
||||
${{ runner.os }}-yarn-${{ matrix.node }}-
|
||||
- run: yarn install --frozen-lockfile
|
||||
- name: run eslint
|
||||
run: yarn eslint
|
||||
|
@ -40,13 +44,17 @@ jobs:
|
|||
- uses: actions/setup-node@v1.4.2
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- uses: actions/cache@v1
|
||||
name: Use Node package cache
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
|
||||
- uses: actions/cache@v2
|
||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||
with:
|
||||
path: node_modules
|
||||
key: bundle-use-node-js-${{ matrix.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock', '**/package.json') }}
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
bundle-use-node-js-${{ matrix.os }}-${{ matrix.node }}-
|
||||
${{ runner.os }}-yarn-${{ matrix.node }}-
|
||||
- run: yarn install --frozen-lockfile
|
||||
- name: run jest
|
||||
run: yarn jest
|
||||
|
@ -68,14 +76,19 @@ jobs:
|
|||
- uses: actions/setup-node@v1.4.2
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- uses: actions/cache@v1
|
||||
name: Use Node package cache
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
|
||||
- uses: actions/cache@v2
|
||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||
with:
|
||||
path: node_modules
|
||||
key: bundle-use-node-js-${{ matrix.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock', '**/package.json') }}
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
bundle-use-node-js-${{ matrix.os }}-${{ matrix.node }}-
|
||||
${{ runner.os }}-yarn-${{ matrix.node }}-
|
||||
- run: yarn install --frozen-lockfile
|
||||
|
||||
- uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby }}
|
||||
|
|
18
.github/workflows/notice_js.yml
vendored
18
.github/workflows/notice_js.yml
vendored
|
@ -1,5 +1,7 @@
|
|||
# License: LGPL-3.0-or-later
|
||||
name: NOTICE-js verification
|
||||
env:
|
||||
node: 14.6.0
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
|
@ -20,14 +22,18 @@ jobs:
|
|||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1.4.2
|
||||
with:
|
||||
node-version: 14.6.0
|
||||
- uses: actions/cache@v1
|
||||
name: Use Node package cache
|
||||
node-version: ${{ env.node }}
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
|
||||
- uses: actions/cache@v2
|
||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||
with:
|
||||
path: node_modules
|
||||
key: bundle-use-node-js-ubuntu-latest-14.6.0-${{ hashFiles('**/yarn.lock', '**/package.json') }}
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ env.node }}-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
bundle-use-node-js-ubuntu-latest-14.6.0-
|
||||
${{ runner.os }}-yarn-${{ env.node }}-
|
||||
- run: yarn install --frozen-lockfile
|
||||
- name: Verify NOTICE-js
|
||||
run: yarn notice:js
|
14
.github/workflows/ruby.yml
vendored
14
.github/workflows/ruby.yml
vendored
|
@ -39,13 +39,17 @@ jobs:
|
|||
- uses: actions/setup-node@v1.4.2
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- uses: actions/cache@v1
|
||||
name: Use Node package cache
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
|
||||
- uses: actions/cache@v2
|
||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||
with:
|
||||
path: node_modules
|
||||
key: bundle-use-node-js-${{ matrix.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock', '**/package.json') }}
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
bundle-use-node-js-${{ matrix.os }}-${{ matrix.node }}-
|
||||
${{ runner.os }}-yarn-${{ matrix.node }}-
|
||||
- run: yarn install --frozen-lockfile
|
||||
- uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0
|
||||
with:
|
||||
|
|
Loading…
Reference in a new issue