Skip to content

Commit a2a0d39

Browse files
ci: add step to cache node_modules
1 parent 006f522 commit a2a0d39

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

.github/workflows/actions.yml

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,36 @@ name: TypeScript Compile and Test CI
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [master]
66

77
jobs:
88
build:
9-
109
runs-on: ubuntu-latest
1110

1211
strategy:
1312
matrix:
1413
node-version: [14.x]
1514

1615
steps:
17-
- name: Checkout
18-
uses: actions/checkout@v2
19-
- name: Use Node.js ${{ matrix.node-version }}
20-
uses: actions/setup-node@v1
21-
with:
22-
node-version: ${{ matrix.node-version }}
23-
- name: Install Yarn
24-
run: npm install -g yarn
25-
- name: Install Dependencies
26-
run: yarn install --frozen-lockfile
27-
- name: Compile TypeScript
28-
run: yarn build-ts
29-
- name: Run Tests
30-
run: yarn test
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v1
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
24+
- name: Cache node_modules directory
25+
- uses: actions/cache@v2
26+
with:
27+
path: '**/node_modules'
28+
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
29+
30+
- name: Install Dependencies
31+
run: yarn install
32+
33+
- name: Compile TypeScript
34+
run: yarn build-ts
35+
36+
- name: Run Tests
37+
run: yarn test

0 commit comments

Comments
 (0)