File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -19,24 +19,30 @@ jobs:
19
19
node-version : [12, 14, 16]
20
20
21
21
steps :
22
- - uses : actions/checkout@v2
22
+ - uses : actions/checkout@v3
23
23
24
24
- name : Use Node ${{ matrix.node-version }}
25
25
uses : actions/setup-node@v2
26
26
with :
27
27
node-version : ${{ matrix.node-version }}
28
28
29
+ - name : Get npm cache directory
30
+ id : npm-cache-dir
31
+ run : |
32
+ echo "::set-output name=dir::$(npm config get cache)"
33
+
29
34
- name : Use cached node_modules
30
- id : cache-tests
35
+ id : npm-cache
31
36
uses : actions/cache@v3
32
37
with :
33
- path : node_modules
34
- key : nodeModules- ${{ hashFiles('./package-lock.json') }}-${{ matrix.node-version }}-tests
38
+ path : ${{ steps.npm-cache-dir.outputs.dir }}
39
+ key : ${{ runner.os }}-node- ${{ matrix.node-version }-${{ hashFiles('**/package-lock.json') }}
35
40
restore-keys : |
36
- nodeModules-
41
+ ${{ runner.os }}-node-${{ matrix.node-version }-
42
+ ${{ runner.os }}-node-
37
43
38
44
- name : Install dependencies
39
- if : steps.cache-tests .outputs.cache-hit != 'true'
45
+ if : steps.npm-cache .outputs.cache-hit != 'true'
40
46
run : npm install
41
47
env :
42
48
CI : true
You can’t perform that action at this time.
0 commit comments