33
33
uses : actions/setup-node@v2
34
34
with :
35
35
node-version : ${{ matrix.node-version }}
36
+ cache : " npm"
36
37
37
38
- name : Use latest NPM
38
39
run : sudo npm i -g npm
71
72
uses : actions/setup-node@v2
72
73
with :
73
74
node-version : ${{ matrix.node-version }}
75
+ cache : " npm"
74
76
75
77
- name : Use latest NPM on ubuntu/macos
76
78
if : matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
80
82
if : matrix.os == 'windows-latest'
81
83
run : npm i -g npm
82
84
83
- - name : Get npm cache directory
84
- id : npm-cache
85
- run : |
86
- echo "::set-output name=dir::$(npm config get cache)"
87
-
88
- - uses : actions/cache@v1
89
- with :
90
- path : ${{ steps.npm-cache.outputs.dir }}
91
- key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
92
- restore-keys : |
93
- ${{ runner.os }}-node-
94
-
95
85
- name : Install dependencies
96
86
run : npm i
97
87
@@ -124,9 +114,10 @@ jobs:
124
114
- uses : actions/checkout@v2
125
115
126
116
- name : Use Node.js ${{ matrix.node-version }}
127
- uses : actions/setup-node@v1
117
+ uses : actions/setup-node@v2
128
118
with :
129
119
node-version : ${{ matrix.node-version }}
120
+ cache : " npm"
130
121
131
122
- name : Use latest NPM on ubuntu/macos
132
123
if : matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
@@ -136,18 +127,6 @@ jobs:
136
127
if : matrix.os == 'windows-latest'
137
128
run : npm i -g npm
138
129
139
- - name : Get npm cache directory
140
- id : npm-cache
141
- run : |
142
- echo "::set-output name=dir::$(npm config get cache)"
143
-
144
- - uses : actions/cache@v1
145
- with :
146
- path : ${{ steps.npm-cache.outputs.dir }}
147
- key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
148
- restore-keys : |
149
- ${{ runner.os }}-node-
150
-
151
130
- name : Install dependencies
152
131
run : npm i
153
132
0 commit comments