-
Notifications
You must be signed in to change notification settings - Fork 43
101 lines (83 loc) · 2.8 KB
/
node-compat.yml
File metadata and controls
101 lines (83 loc) · 2.8 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Node.js Compatibility
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
install-test:
name: Install Test (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
# Node 25 excluded - better-sqlite3 doesn't have prebuilt binaries yet
# and fails to compile with Node 25's V8 API changes
node-version: ['18', '20', '22', '24']
fail-fast: false
container:
image: node:${{ matrix.node-version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Show Node.js version
run: |
node --version
npm --version
- name: Install dependencies
run: npm ci
- name: Ensure rollup optional dependencies are installed
run: npm install --no-save rollup || true
- name: Verify native modules compiled
run: |
echo "Checking that native modules exist..."
ls -la node_modules/better-sqlite3/build/Release/ || echo "better-sqlite3 not built (optional)"
echo "Native module check complete"
- name: Build TypeScript
run: npm run build
- name: Run tests
run: npm test
- name: Test local import (ESM)
run: |
# Test that the built package can be imported locally
node --eval "
import('./dist/src/index.js').then(m => {
console.log('Local ESM import successful');
console.log('Exports:', Object.keys(m));
}).catch(err => {
console.error('Local ESM import failed:', err.message);
process.exit(1);
});
"
# Test that npm install works in a fresh environment
fresh-install:
name: Fresh Install (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
# Node 25 excluded - better-sqlite3 doesn't support it yet
node-version: ['20', '22', '24']
fail-fast: false
container:
image: node:${{ matrix.node-version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Show Node.js version
run: |
node --version
npm --version
- name: Clean install
run: |
rm -rf node_modules package-lock.json
npm install
- name: Verify installation succeeded
run: |
echo "Dependencies installed successfully on Node $(node --version)"
echo "Checking key dependencies..."
ls node_modules/better-sqlite3 && echo "better-sqlite3: OK"
ls node_modules/express && echo "express: OK"
ls node_modules/ws && echo "ws: OK"
echo "All key dependencies present"