3333 uses : actions/setup-node@v2
3434 with :
3535 node-version : ${{ matrix.node-version }}
36+ cache : " npm"
3637
3738 - name : Use latest NPM
3839 run : sudo npm i -g npm
7172 uses : actions/setup-node@v2
7273 with :
7374 node-version : ${{ matrix.node-version }}
75+ cache : " npm"
7476
7577 - name : Use latest NPM on ubuntu/macos
7678 if : matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
8082 if : matrix.os == 'windows-latest'
8183 run : npm i -g npm
8284
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-
9585 - name : Install dependencies
9686 run : npm i
9787
@@ -124,9 +114,10 @@ jobs:
124114 - uses : actions/checkout@v2
125115
126116 - name : Use Node.js ${{ matrix.node-version }}
127- uses : actions/setup-node@v1
117+ uses : actions/setup-node@v2
128118 with :
129119 node-version : ${{ matrix.node-version }}
120+ cache : " npm"
130121
131122 - name : Use latest NPM on ubuntu/macos
132123 if : matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
@@ -136,18 +127,6 @@ jobs:
136127 if : matrix.os == 'windows-latest'
137128 run : npm i -g npm
138129
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-
151130 - name : Install dependencies
152131 run : npm i
153132
0 commit comments