Skip to content

Commit 5c44fe8

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

File tree

1 file changed

+62
-36
lines changed

1 file changed

+62
-36
lines changed

.github/workflows/main.yml

Lines changed: 62 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,74 @@
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: 8
38+
node: 18
39+
- os: macos-latest
40+
eslint: 8
41+
node: 18
42+
# On old ESLint versions
43+
- eslint: 7
44+
node: 18
45+
os: ubuntu-latest
46+
# On the minimum supported ESLint/Node.js version
47+
- eslint: 7.0.0
48+
node: 14.17.0
49+
os: ubuntu-latest
50+
runs-on: ${{ matrix.os }}
2051
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
52+
- name: 🛑 Cancel Previous Runs
53+
uses: styfle/[email protected]
2754

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

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
63+
- name: 📥 Install dependencies
64+
run: npm install
65+
66+
- name: 📥 Install ESLint
67+
run: npm install eslint@${{ matrix.eslint }}
68+
69+
- name: ▶️ Run test script
70+
run: npm run test
71+
72+
- name: ⬆️ Upload coverage report
73+
uses: codecov/codecov-action@v3
4874

0 commit comments

Comments
 (0)