Skip to content

Commit 6f1927e

Browse files
chore(CI): simplify testing strategy (#2)
1 parent f1b34f6 commit 6f1927e

File tree

3 files changed

+59
-52
lines changed

3 files changed

+59
-52
lines changed

.codecov.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/CI.yml

Lines changed: 57 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3,76 +3,85 @@ on:
33
push:
44
branches: [main]
55
pull_request:
6-
branches: [main]
76
schedule:
87
- cron: 0 0 * * 0
98

109
jobs:
1110
lint:
12-
name: Lint
11+
name: Lint
1312
runs-on: ubuntu-latest
1413
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v2
17-
- name: Install Node.js
18-
uses: actions/setup-node@v2
14+
- name: 🛑 Cancel Previous Runs
15+
uses: styfle/[email protected]
16+
17+
- name: ⬇️ Checkout repo
18+
uses: actions/checkout@v3
19+
20+
- name: ⎔ Setup Node
21+
uses: actions/setup-node@v3
1922
with:
20-
node-version: 14
21-
- name: Install Packages
23+
node-version: 18
24+
25+
- name: 📥 Install dependencies
2226
run: npm install
23-
- name: Lint
24-
run: npm run -s lint
27+
28+
- name: ▶️ Run format:check script
29+
run: npm run format:check
30+
31+
- name: ▶️ Run lint script
32+
run: npm run lint
2533

2634
test:
27-
name: Test
35+
name: 🧪 Test (Node@${{ matrix.node }} - ESLint@${{ matrix.eslint }} - ${{
36+
matrix.os }})
2837
strategy:
2938
matrix:
30-
os: [ubuntu-latest]
3139
eslint: [7]
32-
node: [14]
40+
node: [10, 12.0.0, 12, 14.0.0, 14, 16, 18] # 10.0.0 is missing
41+
os: [ubuntu-latest]
3342
include:
3443
# On other platforms
35-
- eslint: 7
36-
node: 14
37-
os: windows-latest
38-
- eslint: 7
39-
node: 14
40-
os: macos-latest
41-
# On old Node.js versions
42-
- eslint: 7
43-
node: 12
44-
os: ubuntu-latest
45-
- eslint: 7
46-
node: 10
47-
os: ubuntu-latest
44+
- os: windows-latest
45+
eslint: 7
46+
node: 18
47+
- os: macos-latest
48+
eslint: 7
49+
node: 18
4850
# On old ESLint versions
4951
- eslint: 6
50-
node: 14
51-
os: ubuntu-latest
52-
- eslint: 5
53-
node: 14
52+
node: 18
5453
os: ubuntu-latest
54+
# - eslint: 5
55+
# node: 18
56+
# os: ubuntu-latest
5557
# On the minimum supported ESLint/Node.js version
56-
- eslint: 5
57-
node: 10
58-
os: ubuntu-latest
58+
# - eslint: 5.0.0
59+
# node: 10.0.0
60+
# os: ubuntu-latest
5961
runs-on: ${{ matrix.os }}
6062
steps:
61-
- name: Checkout
62-
uses: actions/checkout@v2
63-
- name: Install Node.js v${{ matrix.node }}
64-
uses: actions/setup-node@v2
63+
- name: 🛑 Cancel Previous Runs
64+
uses: styfle/[email protected]
65+
66+
- name: ⬇️ Checkout repo
67+
uses: actions/checkout@v3
68+
69+
- name: ⎔ Setup Node v${{ matrix.node }}
70+
uses: actions/setup-node@v3
6571
with:
6672
node-version: ${{ matrix.node }}
67-
- name: Install Packages
73+
74+
- name: 📥 Install dependencies
6875
run: npm install
69-
- name: Install ESLint ${{ matrix.eslint }}
70-
run: npm install --no-save eslint@${{ matrix.eslint }}
71-
- name: Build
72-
run: npm run -s build
73-
- name: Test
74-
run: npm run -s test:mocha
75-
- name: Send Coverage
76-
run: npm run -s codecov
77-
env:
78-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
76+
77+
- name: 📥 Install ESLint v${{ matrix.eslint }}
78+
run: npm install --save-dev eslint@${{ matrix.eslint }}
79+
80+
- name: 🏗 Build
81+
run: npm run build
82+
83+
- name: ▶️ Run test script
84+
run: npm run test
85+
86+
- name: ⬆️ Upload coverage report
87+
uses: codecov/codecov-action@v3

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
},
2424
"devDependencies": {
2525
"@mysticatea/eslint-plugin": "^13.0.0",
26-
"codecov": "^3.6.1",
2726
"dot-prop": "^4.2.0",
2827
"eslint": "^7.24.0",
2928
"esm": "^3.2.25",
@@ -53,9 +52,9 @@
5352
"docs:watch": "vuepress dev docs",
5453
"format": "npm run -s format:prettier -- --write",
5554
"format:prettier": "prettier docs/.vuepress/config.js src/**/*.js test/**/*.js rollup.config.js .vscode/*.json *.json .github/**/*.yml *.yml docs/**/*.md *.md",
55+
"format:check": "npm run -s format:prettier -- --check",
5656
"lint": "eslint docs/.vuepress/config.js src test rollup.config.js",
57-
"test": "run-s \"format:prettier -- --check\" lint build test:mocha",
58-
"test:mocha": "nyc mocha --reporter dot \"test/*.js\"",
57+
"test": "nyc mocha --reporter dot \"test/*.js\"",
5958
"preversion": "npm test && npm run -s build",
6059
"postversion": "git push && git push --tags",
6160
"prewatch": "npm run -s clean",

0 commit comments

Comments
 (0)