Skip to content

Commit e822c21

Browse files
authored
Merge pull request #43 from kleinfreund/chore/cache-dependencies-in-github-actions-workflow
chore: caches node modules in GitHub Actions workflow
2 parents 251c156 + ca22151 commit e822c21

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

.github/workflows/ci.yml

+20-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
on: push
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
types: [opened, reopened, synchronize]
7+
8+
env:
9+
YARN_GPG: no
10+
211
jobs:
312
build:
413
runs-on: ${{ matrix.os }}
@@ -9,12 +18,19 @@ jobs:
918
name: Node.js ${{ matrix.node }} on ${{ matrix.os }}
1019
steps:
1120
- uses: actions/checkout@v3
21+
1222
- name: Setup node
1323
uses: actions/setup-node@v3
1424
with:
1525
node-version: ${{ matrix.node }}
16-
# cache: npm
26+
27+
- name: Cache node_modules
28+
uses: actions/cache@v3
29+
id: cache
30+
with:
31+
path: node_modules
32+
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package.json') }}
33+
1734
- run: npm install
35+
1836
- run: npm test
19-
env:
20-
YARN_GPG: no

0 commit comments

Comments
 (0)