-
Notifications
You must be signed in to change notification settings - Fork 204
57 lines (45 loc) · 1.48 KB
/
ci.yml
File metadata and controls
57 lines (45 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
check:
name: Lint, typecheck, test, build (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [20, 22]
steps:
- uses: actions/checkout@v6
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: npm ci
- name: Typecheck
run: npm run typecheck
- name: Lint
run: npm run lint
- name: Test
run: npm test
- name: Build
run: npm run build
- name: Browser bundle hygiene check
run: |
# Only flag actual imports/requires of node: modules — not string
# literals or comments that happen to contain "node:".
if grep -E "require\(['\"](node:|crypto|buffer|fs)['\"]|import.*from.*['\"]node:|import\s+['\"]node:" dist/index.browser.js; then
echo "::error::Browser bundle contains forbidden Node imports"
exit 1
fi
- name: Bundle size budget
run: npm run check:bundle-size
- name: Smoke test ESM example
run: cd examples/node-esm && npm install --no-package-lock && npm start
- name: Smoke test CJS example
run: cd examples/node-cjs && npm install --no-package-lock && npm start