Skip to content

Commit b3201f8

Browse files
committed
cache node deps
1 parent 2c599ca commit b3201f8

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/test.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- uses: actions/checkout@master
21+
- name: Get yarn cache directory path
22+
id: yarn-cache-dir-path
23+
run: echo "::set-output name=dir::$(yarn cache dir)"
24+
- uses: actions/cache@v2
25+
id: yarn-cache
26+
with:
27+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
28+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}
29+
restore-keys: |
30+
${{ runner.os }}-yarn-
2131
- run: yarn
2232
- run: yarn check-lint
2333
- run: yarn check-format
@@ -26,6 +36,16 @@ jobs:
2636
runs-on: ubuntu-latest
2737
steps:
2838
- uses: actions/checkout@master
39+
- name: Get yarn cache directory path
40+
id: yarn-cache-dir-path
41+
run: echo "::set-output name=dir::$(yarn cache dir)"
42+
- uses: actions/cache@v2
43+
id: yarn-cache
44+
with:
45+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
46+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}
47+
restore-keys: |
48+
${{ runner.os }}-yarn-
2949
- run: yarn && yarn build
3050
- name: Check if js dist files are current
3151
id: changes
@@ -127,5 +147,15 @@ jobs:
127147
runs-on: ubuntu-latest
128148
steps:
129149
- uses: actions/checkout@master
150+
- name: Get yarn cache directory path
151+
id: yarn-cache-dir-path
152+
run: echo "::set-output name=dir::$(yarn cache dir)"
153+
- uses: actions/cache@v2
154+
id: yarn-cache
155+
with:
156+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
157+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}
158+
restore-keys: |
159+
${{ runner.os }}-yarn-
130160
- run: yarn
131161
- run: yarn test

0 commit comments

Comments
 (0)