Use yarn cache dir for correct caching

This commit is contained in:
Marc Rousavy 2021-02-23 14:46:11 +01:00
parent e8aa9d81c2
commit c2908e12e1

View File

@ -24,14 +24,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- 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
with:
path: |
node_modules
example/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
${{ runner.os }}-yarn-
- name: Install modules
run: yarn
- name: Install modules (example/)
@ -42,18 +46,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- 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
with:
path: |
node_modules
example/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
# - name: Install modules
# run: yarn
# - name: Install modules (example/)
# run: yarn example
${{ runner.os }}-yarn-
- name: Run TypeScript
run: yarn typescript
lint:
@ -62,17 +66,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- 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
with:
path: |
node_modules
example/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-
# - name: Install modules
# run: yarn
# - name: Install modules (example/)
# run: yarn example
${{ runner.os }}-yarn-
- name: Run ESLint
run: yarn lint-ci