Skip to content

Commit 407a938

Browse files
chore(CI): simplify testing strategy (#2)
1 parent e2d29cb commit 407a938

File tree

3 files changed

+43
-22
lines changed

3 files changed

+43
-22
lines changed

.codecov.yml

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

.github/workflows/ci.yml

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,54 @@ 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
13+
steps:
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
22+
with:
23+
node-version: 18
24+
25+
- name: 📥 Install dependencies
26+
run: npm install
27+
28+
- name: ▶️ Run lint script
29+
run: npm run lint
30+
31+
test:
32+
name:
33+
🧪 Test (Node@${{ matrix.node }})
1434
strategy:
1535
matrix:
16-
node: [12.x, 10.x, 8.x]
36+
node: [8.0.0, 8, 10, 12, 14, 16, 18]
37+
runs-on: ubuntu-latest
1738
steps:
18-
- name: Checkout
19-
uses: actions/checkout@v1
20-
- name: Install Node.js ${{ matrix.node }}
21-
uses: actions/setup-node@v1
39+
- name: 🛑 Cancel Previous Runs
40+
uses: styfle/[email protected]
41+
42+
- name: ⬇️ Checkout repo
43+
uses: actions/checkout@v3
44+
45+
- name: ⎔ Setup Node v${{ matrix.node }}
46+
uses: actions/setup-node@v3
2247
with:
2348
node-version: ${{ matrix.node }}
24-
- name: Install Packages
49+
50+
- name: 📥 Install dependencies
2551
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 }}
52+
53+
- name: ▶️ Run test script
54+
run: npm run test
55+
- name: ⬆️ Upload coverage report
56+
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 @eslint-community/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)