Skip to content

Commit cbe97b4

Browse files
committed
setup github test workflow
1 parent 2f9e8ab commit cbe97b4

File tree

4 files changed

+612
-3
lines changed

4 files changed

+612
-3
lines changed

.github/workflows/test.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Test
5+
6+
on:
7+
push:
8+
branches: [main]
9+
pull_request:
10+
branches: [main]
11+
12+
jobs:
13+
test:
14+
name: Unit tests
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v5
18+
- uses: actions/setup-node@v5
19+
with:
20+
node-version: 22
21+
- run: npm ci --ignore-scripts --no-audit --no-fund
22+
- run: npm test
23+
- name: Upload coverage reports to Codecov
24+
uses: codecov/codecov-action@v5
25+
with:
26+
token: ${{ secrets.CODECOV_TOKEN }}
27+
28+
check-ts:
29+
name: Check types
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v5
33+
- uses: actions/setup-node@v5
34+
with:
35+
node-version: 22
36+
- run: npm ci --ignore-scripts --no-audit --no-fund
37+
- run: npm run check
38+
39+
lint-code:
40+
name: Lint code (oxlint)
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v5
44+
- uses: actions/setup-node@v5
45+
with:
46+
node-version: 22
47+
- run: npm ci --ignore-scripts --no-audit --no-fund
48+
- run: npm run lint
49+
50+
declutter-code:
51+
name: Declutter code (Knip)
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v5
55+
- uses: actions/setup-node@v5
56+
with:
57+
node-version: 22
58+
- run: npm ci --ignore-scripts --no-audit --no-fund
59+
- run: npm run knip
60+
61+
lint-package:
62+
name: Lint package (publint)
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/checkout@v5
66+
- uses: actions/setup-node@v5
67+
with:
68+
node-version: 22
69+
- run: npm ci --ignore-scripts --no-audit --no-fund
70+
- run: npm run build
71+
- run: npm run lint-package
72+
73+
bundle-analysis:
74+
name: Report bundle analysis (codecov)
75+
runs-on: ubuntu-latest
76+
steps:
77+
- uses: actions/checkout@v5
78+
- uses: actions/setup-node@v5
79+
with:
80+
node-version: 22
81+
- run: npm ci --ignore-scripts --no-audit --no-fund
82+
- run: npm run build
83+
env:
84+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
85+
86+
npm-audit:
87+
name: Audit packages
88+
runs-on: ubuntu-latest
89+
steps:
90+
- uses: actions/checkout@v5
91+
- uses: actions/setup-node@v5
92+
with:
93+
node-version: 22
94+
- run: npm audit --audit-level=high

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Built for speed and efficiency, this parser handles large CSS files with minimal
1515

1616
## Performance
1717

18-
- **Tiny install size** -
19-
- **Zero allocations during parsing** - all memory allocated upfront, which also helps prevent garbage collection running often
18+
- **Tiny install size**
19+
- **Zero allocations during parsing** - all memory allocated upfront based on real world heuristics, which also helps prevent garbage collection running often
2020
- **Cache-friendly data layout** - contiguous memory for sequential access
2121
- **First-class comment and location support** - while still being performant because analysis requires constant access to lines and columns
2222
- **No syntax validation** - focusing only on the raw data we can skip expensive syntax files and MDN data syncs

0 commit comments

Comments
 (0)