@@ -12,22 +12,28 @@ 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 : |
36
+ echo ${{ steps.yarn-cache.outputs.cache-hit }}
31
37
yarn install
32
38
yarn ci
33
39
- name : Build All Packages
@@ -41,19 +47,25 @@ jobs:
41
47
- uses : actions/setup-node@v2
42
48
with :
43
49
node-version : 12
50
+ - id : yarn-cache-dir
51
+ name : Find Yarn's cache folder
52
+ run : echo "::set-output name=path::$(yarn config get cacheFolder)"
44
53
- name : Cache node modules
45
54
uses : actions/cache@v2
55
+ id : yarn-cache
46
56
env :
47
57
cache-name : cache-node-modules
48
58
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') }}
59
+ path : ${{ steps.yarn-cache-dir.outputs.path }}
60
+ key : ${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
52
61
restore-keys : |
53
- ${{ runner.os }}-build -${{ env.cache-name }}-
54
- ${{ runner.os }}-build -
62
+ ${{ runner.os }}-yarn -${{ env.cache-name }}-
63
+ ${{ runner.os }}-yarn -
55
64
${{ runner.os }}-
56
- - env :
65
+ - name : Install dependencies
66
+ if : |
67
+ ${{ steps.yarn-cache.outputs.cache-hit }} != 'true'
68
+ env :
57
69
CI : true
58
70
run : |
59
71
yarn install
0 commit comments