@@ -19,19 +19,23 @@ 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: ${{ !steps.yarn-cache.outputs.cache-hit }}
35
39
env :
36
40
CI : true
37
41
run : |
@@ -49,19 +53,24 @@ jobs:
49
53
- uses : actions/setup-node@v2
50
54
with :
51
55
node-version : 12
56
+ - id : yarn-cache-dir
57
+ name : Find Yarn's cache folder
58
+ run : echo "::set-output name=path::$(yarn config get cacheFolder)"
52
59
- name : Cache node modules
53
60
uses : actions/cache@v2
61
+ id : yarn-cache
54
62
env :
55
63
cache-name : cache-node-modules
56
64
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') }}
65
+ path : ${{ steps.yarn-cache-dir.outputs.path }}
66
+ key : ${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
60
67
restore-keys : |
61
- ${{ runner.os }}-build -${{ env.cache-name }}-
62
- ${{ runner.os }}-build -
68
+ ${{ runner.os }}-yarn -${{ env.cache-name }}-
69
+ ${{ runner.os }}-yarn -
63
70
${{ runner.os }}-
64
- - env :
71
+ - name : Install dependencies
72
+ # if: ${{ !steps.yarn-cache.outputs.cache-hit }}
73
+ env :
65
74
CI : true
66
75
run : |
67
76
yarn install
0 commit comments