Skip to content

Commit e3dbb6a

Browse files
committed
test: add npm caching
1 parent ec65723 commit e3dbb6a

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/nodejs.yml

+24
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,18 @@ jobs:
8080
if: matrix.os == 'windows-latest'
8181
run: npm i -g npm
8282

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+
8395
- name: Install dependencies
8496
run: npm i
8597

@@ -124,6 +136,18 @@ jobs:
124136
if: matrix.os == 'windows-latest'
125137
run: npm i -g npm
126138

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+
127151
- name: Install dependencies
128152
run: npm i
129153

0 commit comments

Comments
 (0)