Skip to content

Commit bd485dd

Browse files
authored
chore: split CI in separate jobs (#133)
1 parent 7d2b58d commit bd485dd

File tree

3 files changed

+269
-18
lines changed

3 files changed

+269
-18
lines changed

.github/workflows/test.yml

Lines changed: 73 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,82 @@ jobs:
1414
name: Unit tests
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v5
1818
- name: Use Node.js
19-
uses: actions/setup-node@v4
19+
uses: actions/setup-node@v5
2020
with:
2121
cache: 'npm'
22-
- name: Install dependencies
23-
run: npm install --ignore-scripts --no-audit --no-fund
24-
- name: Unit tests
25-
run: npm test
26-
- name: Check types
27-
run: npm run check
28-
- name: Lint JS
29-
run: npx oxlint@latest -D perf
30-
- name: Build package
31-
run: npm run build
22+
node-version: 22
23+
- run: npm ci --ignore-scripts --no-audit --no-fund
24+
- run: npm test
25+
26+
check:
27+
name: Check types
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v5
31+
- name: Use Node.js
32+
uses: actions/setup-node@v5
33+
with:
34+
cache: 'npm'
35+
node-version: 22
36+
- run: npm ci --ignore-scripts --no-audit --no-fund
37+
- run: npm run check
38+
39+
build:
40+
name: Build & collect coverage
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v5
44+
- name: Use Node.js
45+
uses: actions/setup-node@v5
46+
with:
47+
cache: 'npm'
48+
node-version: 22
49+
- run: npm ci --ignore-scripts --no-audit --no-fund
50+
- run: npm run build
3251
env:
3352
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
34-
- name: 'Publint'
35-
run: 'npx --yes publint'
36-
- name: Upload coverage reports to Codecov
37-
uses: codecov/[email protected]
53+
54+
lint:
55+
name: Lint
56+
runs-on: ubuntu-latest
57+
steps:
58+
- name: Checkout code
59+
uses: actions/checkout@v5
60+
- name: Use Node.js
61+
uses: actions/setup-node@v5
62+
with:
63+
cache: 'npm'
64+
node-version: 22
65+
- run: npm ci --ignore-scripts --no-audit --no-fund
66+
- run: npm run build
67+
- run: npm run lint
68+
69+
lint-package:
70+
name: Lint package
71+
runs-on: ubuntu-latest
72+
steps:
73+
- name: Checkout code
74+
uses: actions/checkout@v5
75+
- name: Use Node.js
76+
uses: actions/setup-node@v5
3877
with:
39-
token: ${{ secrets.CODECOV_TOKEN }}
78+
cache: 'npm'
79+
node-version: 22
80+
- run: npm ci --ignore-scripts --no-audit --no-fund
81+
- run: npm run build
82+
- run: npm run lint-package
83+
84+
npm-audit:
85+
name: Audit packages
86+
runs-on: ubuntu-latest
87+
steps:
88+
- name: Checkout code
89+
uses: actions/checkout@v5
90+
- name: Use Node.js
91+
uses: actions/setup-node@v5
92+
with:
93+
cache: 'npm'
94+
node-version: 22
95+
- run: npm audit --audit-level=high

package-lock.json

Lines changed: 191 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,17 @@
2424
"build": "vite build",
2525
"test": "c8 --reporter=lcov uvu",
2626
"check": "tsc",
27-
"prettier": "prettier --check index.js test/**/*.js"
27+
"prettier": "prettier --check index.js test/**/*.js",
28+
"lint": "oxlint",
29+
"lint-package": "publint"
2830
},
2931
"devDependencies": {
3032
"@codecov/vite-plugin": "^1.9.0",
3133
"@types/css-tree": "^2.3.10",
3234
"c8": "^10.1.3",
35+
"oxlint": "^1.24.0",
3336
"prettier": "^3.5.3",
37+
"publint": "^0.3.15",
3438
"typescript": "^5.8.3",
3539
"uvu": "^0.5.6",
3640
"vite": "^6.2.6",

0 commit comments

Comments
 (0)