@@ -19,19 +19,25 @@ jobs:
19
19
uses : actions/setup-node@v2
20
20
with :
21
21
node-version : 12
22
+ - id : yarn-cache-dir
23
+ name : Find Yarn's cache folder
24
+ run : echo "::set-output name=path::$(yarn config get cacheFolder)"
22
25
- name : Cache node modules
23
26
uses : actions/cache@v2
27
+ id : yarn-cache
24
28
env :
25
29
cache-name : cache-node-modules
26
30
with :
27
- # npm cache files are stored in `~/.npm` on Linux/macOS
28
- path : ~/.npm
29
- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
31
+ path : ${{ steps.yarn-cache-dir.outputs.path }}
32
+ key : ${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
30
33
restore-keys : |
31
- ${{ runner.os }}-build -${{ env.cache-name }}-
32
- ${{ runner.os }}-build -
34
+ ${{ runner.os }}-yarn -${{ env.cache-name }}-
35
+ ${{ runner.os }}-yarn -
33
36
${{ runner.os }}-
34
37
- name : Install dependencies
38
+ if : |
39
+ steps.yarn-cache-dir.outputs.cache-hit != 'true'
40
+ steps.yarn-cache.outputs.cache-hit != 'true'
35
41
env :
36
42
CI : true
37
43
run : |
@@ -49,19 +55,26 @@ jobs:
49
55
- uses : actions/setup-node@v2
50
56
with :
51
57
node-version : 12
58
+ - id : yarn-cache-dir
59
+ name : Find Yarn's cache folder
60
+ run : echo "::set-output name=path::$(yarn config get cacheFolder)"
52
61
- name : Cache node modules
53
62
uses : actions/cache@v2
63
+ id : yarn-cache
54
64
env :
55
65
cache-name : cache-node-modules
56
66
with :
57
- # npm cache files are stored in `~/.npm` on Linux/macOS
58
- path : ~/.npm
59
- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
67
+ path : ${{ steps.yarn-cache-dir.outputs.path }}
68
+ key : ${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
60
69
restore-keys : |
61
- ${{ runner.os }}-build -${{ env.cache-name }}-
62
- ${{ runner.os }}-build -
70
+ ${{ runner.os }}-yarn -${{ env.cache-name }}-
71
+ ${{ runner.os }}-yarn -
63
72
${{ runner.os }}-
64
- - env :
73
+ - name : Install dependencies
74
+ if : |
75
+ steps.yarn-cache-dir.outputs.cache-hit != 'true'
76
+ steps.yarn-cache.outputs.cache-hit != 'true'
77
+ env :
65
78
CI : true
66
79
run : |
67
80
yarn install
0 commit comments