Skip to content

Commit fffd3ee

Browse files
committed
chore: add node_modules caching to CI
1 parent 464a0a3 commit fffd3ee

File tree

1 file changed

+39
-27
lines changed

1 file changed

+39
-27
lines changed

.github/workflows/check.yml

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
node-version: [12, 14, 15, 16]
18+
node-version: [ 12, 14, 15, 16 ]
1919

2020
steps:
2121
-
@@ -25,45 +25,57 @@ jobs:
2525
uses: actions/setup-node@v1
2626
with:
2727
node-version: ${{ matrix.node-version }}
28-
# -
29-
# name: Cache Node Modules
30-
# if: ${{ matrix.node-version == 14 }}
31-
# uses: actions/cache@v2
32-
# with:
33-
# path: |
34-
# node_modules
35-
# build
36-
# key: cache-${{ github.run_id }}-v14
37-
# -
38-
# name: Upgrade NPM to have workspaces support
39-
# run: npm i -G npm
28+
-
29+
name: Cache node_modules
30+
uses: actions/cache@v2
31+
with:
32+
path: '**/node_modules'
33+
key: ${{ runner.os }}-${{ matrix.node-version }}-modules-${{ hashFiles('**/yarn.lock') }}
4034
-
4135
name: Install Dependencies
4236
run: npm install
4337
-
4438
name: Run Tests
4539
run: npm test
4640

47-
lint:
48-
name: Lint
49-
needs: [build_and_test]
41+
build:
42+
name: Build
5043
runs-on: ubuntu-latest
5144

5245
steps:
46+
- uses: actions/checkout@v2
47+
- name: Use Node.js 14
48+
uses: actions/setup-node@v1
49+
with:
50+
node-version: 14
5351
-
54-
uses: actions/checkout@v2
52+
name: Cache node_modules
53+
uses: actions/cache@v2
54+
with:
55+
path: '**/node_modules'
56+
key: ${{ runner.os }}-${{ matrix.node-version }}-modules-${{ hashFiles('**/yarn.lock') }}
5557
-
56-
name: Use Node.js 14
58+
name: Install Dependencies
59+
run: npm install
60+
- run: npm run build
61+
62+
lint:
63+
name: Lint
64+
runs-on: ubuntu-latest
65+
66+
steps:
67+
- uses: actions/checkout@v2
68+
- name: Use Node.js 14
5769
uses: actions/setup-node@v1
5870
with:
5971
node-version: 14
60-
# -
61-
# name: Load Cache
62-
# uses: actions/cache@v2
63-
# with:
64-
# path: |
65-
# node_modules
66-
# build
67-
# key: cache-${{ github.run_id }}-v14
6872
-
69-
run: npm run lint
73+
name: Cache node_modules
74+
uses: actions/cache@v2
75+
with:
76+
path: '**/node_modules'
77+
key: ${{ runner.os }}-${{ matrix.node-version }}-modules-${{ hashFiles('**/yarn.lock') }}
78+
-
79+
name: Install Dependencies
80+
run: npm install
81+
- run: npm run lint

0 commit comments

Comments
 (0)