Skip to content

Commit cb002ce

Browse files
committed
chore(CI): simplify testing strategy
1 parent b1d8da3 commit cb002ce

File tree

1 file changed

+58
-36
lines changed

1 file changed

+58
-36
lines changed

.github/workflows/main.yml

Lines changed: 58 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,70 @@
11
name: CI
2-
32
on:
4-
- push
5-
- pull_request
3+
push:
4+
pull_request:
65

76
jobs:
7+
lint:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: 🛑 Cancel Previous Runs
11+
uses: styfle/[email protected]
12+
13+
- name: ⬇️ Checkout repo
14+
uses: actions/checkout@v3
15+
16+
- name: ⎔ Setup Node
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 18
20+
21+
- name: 📥 Install dependencies
22+
run: npm install
23+
24+
- name: ▶️ Run lint script
25+
run: npm run lint
26+
827
test:
9-
name: Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
10-
runs-on: ${{ matrix.os }}
28+
name: Test (Node@${{ matrix.node }} - ESLint@${{ matrix.eslint }} - ${{ matrix.os }})
1129
strategy:
12-
fail-fast: false
1330
matrix:
14-
node-version:
15-
- '18'
16-
- '16'
17-
- '14'
18-
os:
19-
- ubuntu-latest
31+
eslint: [8]
32+
node: [14.17.0, 14, 16.0.0, 16, 18.0.0, 18]
33+
os: [ubuntu-latest]
34+
include:
35+
# On other platforms
36+
- os: windows-latest
37+
eslint: 6
38+
node: 18
39+
- os: macos-latest
40+
eslint: 6
41+
node: 18
42+
# On the minimum supported ESLint/Node.js version
43+
- eslint: 7.0.0
44+
node: 14.17.0
45+
os: ubuntu-latest
46+
runs-on: ${{ matrix.os }}
2047
steps:
21-
- uses: actions/checkout@v3
22-
- uses: actions/setup-node@v3
23-
with:
24-
node-version: ${{ matrix.node-version }}
25-
- run: npm install
26-
- run: npm test
48+
- name: 🛑 Cancel Previous Runs
49+
uses: styfle/[email protected]
2750

28-
lint:
29-
runs-on: ubuntu-latest
30-
steps:
31-
- uses: actions/checkout@v3
32-
- uses: actions/setup-node@v3
51+
- name: ⬇️ Checkout repo
52+
uses: actions/checkout@v3
53+
54+
- name: ⎔ Setup Node
55+
uses: actions/setup-node@v3
3356
with:
34-
node-version: "18.x"
35-
- run: npm install
36-
- run: npm run lint
57+
node-version: ${{ matrix.node }}
3758

38-
eslint7:
39-
runs-on: ubuntu-latest
40-
steps:
41-
- uses: actions/checkout@v3
42-
- uses: actions/setup-node@v3
43-
with:
44-
node-version: "18.x"
45-
- run: npm install
46-
- run: npm install --save-dev eslint@7
47-
- run: npm test
59+
- name: 📥 Install dependencies
60+
run: npm install
61+
62+
- name: 📥 Install ESLint
63+
run: npm install eslint@${{ matrix.eslint }}
64+
65+
- name: ▶️ Run test script
66+
run: npm run test
67+
68+
- name: ⬆️ Upload coverage report
69+
uses: codecov/codecov-action@v3
4870

0 commit comments

Comments
 (0)