Skip to content

Commit be24f56

Browse files
committed
chore(CI): simplify testing strategy
1 parent ccb07e9 commit be24f56

File tree

3 files changed

+50
-25
lines changed

3 files changed

+50
-25
lines changed

.codecov.yml

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

.github/workflows/ci.yml

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

109
jobs:
11-
test:
12-
name: Test
10+
lint:
11+
name: ⬣ Lint
1312
runs-on: ubuntu-latest
14-
strategy:
15-
matrix:
16-
node: [12.x, 10.x, 8.x]
1713
steps:
18-
- name: Checkout
19-
uses: actions/checkout@v1
20-
- name: Install Node.js ${{ matrix.node }}
21-
uses: actions/setup-node@v1
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
2222
with:
23-
node-version: ${{ matrix.node }}
24-
- name: Install Packages
23+
node-version: 18
24+
25+
- name: 📥 Install dependencies
2526
run: npm install
26-
- name: Test
27-
run: npm test
28-
- name: Send Coverage
29-
run: npm run -s codecov
30-
env:
31-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
27+
28+
- name: ▶️ Run format:check script
29+
run: npm run format:check
30+
31+
- name: ▶️ Run lint script
32+
run: npm run lint
33+
34+
test:
35+
name:
36+
🧪 Test (Node@${{ matrix.node }})
37+
strategy:
38+
matrix:
39+
node: [8.0.0, 8, 10, 12, 14, 16, 18]
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: 🛑 Cancel Previous Runs
43+
uses: styfle/[email protected]
44+
45+
- name: ⬇️ Checkout repo
46+
uses: actions/checkout@v3
47+
48+
- name: ⎔ Setup Node v${{ matrix.node }}
49+
uses: actions/setup-node@v3
50+
with:
51+
node-version: ${{ matrix.node }}
52+
53+
- name: 📥 Install dependencies
54+
run: npm install
55+
56+
- name: ▶️ Run test script
57+
run: npm run test
58+
59+
- name: ⬆️ Upload coverage report
60+
uses: codecov/codecov-action@v3

package.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"@types/jsdom": "^12.2.4",
2424
"@types/mocha": "^5.2.2",
2525
"@types/node": "^12.6.8",
26-
"codecov": "^3.5.0",
2726
"dts-bundle": "^0.7.3",
2827
"eslint": "^6.1.0",
2928
"jsdom": "^15.1.1",
@@ -44,16 +43,14 @@
4443
"build:rollup": "rollup -c",
4544
"build:dts": "dts-bundle --name regexpp --main .temp/index.d.ts --out ../index.d.ts",
4645
"clean": "rimraf .temp index.*",
47-
"codecov": "nyc report -r lcovonly && codecov -t ${CODECOV_TOKEN} --disable=gcov",
48-
"lint": "eslint scripts src test --ext .ts",
49-
"pretest": "run-s build lint",
46+
"lint": "eslint . --ext .ts",
47+
"pretest": "npm run build build",
5048
"test": "nyc _mocha \"test/*.ts\" --reporter dot --timeout 10000",
5149
"update:test": "ts-node scripts/update-fixtures.ts",
5250
"update:unicode": "run-s update:unicode:*",
5351
"update:unicode:ids": "ts-node scripts/update-unicode-ids.ts",
5452
"update:unicode:props": "ts-node scripts/update-unicode-properties.ts",
55-
"preversion": "npm test",
56-
"version": "npm run -s build",
53+
"preversion": "npm test && npm run -s build",
5754
"postversion": "git push && git push --tags",
5855
"prewatch": "npm run -s clean",
5956
"watch": "_mocha \"test/*.ts\" --require ts-node/register --reporter dot --timeout 10000 --watch-extensions ts --watch --growl"

0 commit comments

Comments
 (0)