-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (55 loc) · 1.78 KB
/
Copy pathci.yml
File metadata and controls
68 lines (55 loc) · 1.78 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
# vitest 4 (via rolldown) needs Node >=20.19; the engines floor of 18
# is covered by the node18-runtime job below, against the shipped dist.
node-version: [20.x, 24.x]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Test
run: npm test
- name: Smoke test the built gateway
run: npm run smoke
- name: Verify committed dist matches source
if: matrix.node-version == '24.x'
run: |
if ! git diff --exit-code --stat dist/; then
echo "::error::dist/ is stale - run 'npm run build' and commit the result"
exit 1
fi
node18-runtime:
# The package declares engines >=18. The test runner cannot run there, so
# verify the *published artifact* loads and serves traffic on the floor,
# installed with production dependencies only. This is the backstop that
# catches ESM-only dependencies (ERR_REQUIRE_ESM) before users do.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.x
cache: npm
- name: Install production dependencies only
run: npm ci --omit=dev
- name: CLI runs on the engines floor
run: |
node dist/cli.js --version
node dist/cli.js models | head -20
- name: Smoke test the shipped dist
run: node scripts/smoke.mjs