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