Skip to content

Commit e27f9dc

Browse files
committed
switch coverall to codecov
1 parent 60efc7d commit e27f9dc

4 files changed

Lines changed: 27 additions & 38 deletions

File tree

.github/workflows/test.yml

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,27 @@
1-
name: test
2-
on:
3-
push:
4-
branches:
5-
- "main"
6-
- "master"
7-
pull_request:
1+
name: Test
82

9-
defaults:
10-
run:
11-
shell: bash
3+
on: [push, pull_request]
124

135
jobs:
146
test:
15-
runs-on: ubuntu-latest
7+
runs-on: ${{ matrix.os }}
168
strategy:
17-
fail-fast: false
9+
fail-fast: true
1810
matrix:
19-
# Maintained Node.js LTS lines. The published es5 dist still runs on
20-
# older Node, but the test runner (node:test) requires Node >= 18.
21-
node: [22, 24]
11+
os: [ubuntu-latest, windows-latest]
12+
node-version: [lts/*, latest]
2213
steps:
2314
- uses: actions/checkout@v4
15+
- name: Use Node.js ${{ matrix.node-version }}
16+
uses: actions/setup-node@v4
2417
with:
25-
fetch-depth: 1
26-
- uses: actions/setup-node@v4
18+
node-version: ${{ matrix.node-version }}
19+
- run: npm ci
20+
- run: npm test
21+
- name: Upload coverage to Codecov
22+
if: matrix.os == 'ubuntu-latest' && matrix.node-version == 'lts/*'
23+
uses: codecov/codecov-action@v5
2724
with:
28-
node-version: ${{ matrix.node }}
29-
30-
- name: npm ci
31-
run: npm ci --ignore-scripts
32-
33-
- name: test
34-
run: npm run test:coverage
35-
36-
- name: lint
37-
run: npm run lint
38-
39-
- name: typecheck
40-
run: npm run typecheck
25+
token: ${{ secrets.CODECOV_TOKEN }}
26+
files: ./coverage/lcov.info
27+
fail_ci_if_error: false

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
.nyc_output
21
coverage
32
node_modules
43
dist
54
.idea
6-
.vscode
5+
.vscode

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@
2828
"lint:fix": "oxlint --fix",
2929
"format": "oxfmt src",
3030
"format:check": "oxfmt --check src",
31+
"pretests": "npm run build",
32+
"tests": "node --test src/__tests__/*.mjs",
33+
"precoverage": "npm run build",
34+
"coverage": "c8 node --test src/__tests__/*.mjs",
3135
"pretest": "npm run build",
32-
"test": "node --test src/__tests__/*.mjs",
33-
"pretest:coverage": "npm run build",
34-
"test:coverage": "c8 node --test src/__tests__/*.mjs",
36+
"test": "npm run lint && npm run typecheck && npm run tests && npm run coverage",
3537
"prepare": "npm run build",
3638
"release": "npx npmpub"
3739
},
@@ -66,7 +68,8 @@
6668
],
6769
"reporter": [
6870
"text",
69-
"text-summary"
71+
"text-summary",
72+
"lcovonly"
7073
],
7174
"all": true
7275
}

src/__tests__/exceptions.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ throws('bad syntax', '-moz-osx-font-smoothing: grayscale');
2222
throws('bad syntax (2)', '! .body');
2323

2424
throws('missing backslash for semicolon', '.;');
25-
throws('missing backslash for semicolon (2)', '.;');
26-
throws('unexpected / foo', '-Option/root', "Unexpected '/'. Escaping special characters with \\ may help.");
25+
throws('missing backslash for semicolon (2)', '.\;');
26+
throws('unexpected / foo', '-Option\/root', "Unexpected '/'. Escaping special characters with \\ may help.");
2727
throws('bang in selector', '.foo !optional', "Unexpected '!'. Escaping special characters with \\ may help.");

0 commit comments

Comments
 (0)