Skip to content

Commit 698275c

Browse files
committed
Add caching for npm modules
Partly for a tiny speedup, partly to avoid stderr output that is treated as notably error output by github actions.
1 parent 7709a28 commit 698275c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ jobs:
1818
with:
1919
node-version: 14
2020

21+
- name: Get npm cache directory
22+
id: npm-cache
23+
run: |
24+
echo "::set-output name=dir::$(npm config get cache)"
25+
- uses: actions/cache@v2
26+
with:
27+
path: ${{ steps.npm-cache.outputs.dir }}
28+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
29+
restore-keys: |
30+
${{ runner.os }}-node-
31+
2132
- run: npm ci
2233

2334
- run: npm run build

0 commit comments

Comments
 (0)