-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (116 loc) · 3.79 KB
/
Copy pathci.yml
File metadata and controls
125 lines (116 loc) · 3.79 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: CI
on:
push:
branches: [main]
paths-ignore:
- "**.md"
- "docs/**"
- "demo/**"
- "LICENSE"
pull_request:
branches: [main]
paths-ignore:
- "**.md"
- "docs/**"
- "demo/**"
- "LICENSE"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup
- run: pnpm run lint
typecheck:
name: Typecheck
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup
- run: pnpm run typecheck
generated-types-fresh:
# Catches schema edits where contributors forget to re-run generate:types.
# The generated file is committed (so consumers can grep types in the
# repo); this job makes sure that committed copy still matches the schema.
name: Generated types in sync
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup
- run: pnpm run generate:types
- run: |
# Treat both modified-tracked and untracked-but-expected-to-be-tracked
# as failures. `git ls-files --error-unmatch` returns nonzero when
# the file isn't tracked; `git diff --quiet` checks the tracked diff.
if ! git ls-files --error-unmatch src/types.generated.ts >/dev/null 2>&1; then
echo "::error::src/types.generated.ts is not committed. Run 'pnpm run generate:types' and commit the result."
exit 1
fi
if ! git diff --quiet src/types.generated.ts; then
echo "::error::src/types.generated.ts is stale. Run 'pnpm run generate:types' and commit the result."
git --no-pager diff src/types.generated.ts | head -50
exit 1
fi
test:
name: Test (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
node-version: [20, 22, 24]
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup
with:
node-version: ${{ matrix.node-version }}
- run: pnpm run test:coverage
- name: Upload coverage to Codecov
if: matrix.node-version == 22
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/lcov.info
fail_ci_if_error: false
test-bun:
name: Test (Bun)
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup
- uses: oven-sh/setup-bun@v2
- run: bun --bun run vitest run
test-deno:
name: Smoke (Deno)
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup
- run: pnpm run build
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
# Deno can consume the published ESM build directly. We're not running
# the full vitest suite — just confirming the artifacts load + validate.
- run: deno run --allow-read scripts/smoke-deno.ts
smoke-workers:
name: Smoke (Cloudflare Workers build)
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup
- run: pnpm run build
# Bundle the standalone validator with esbuild in worker mode. If any
# Node-only API or require() sneaks in, this fails — protecting the
# README's "works in a Worker" claim.
- run: pnpm exec esbuild --bundle --format=esm --platform=neutral --target=es2022 --outfile=/tmp/worker.js scripts/smoke-worker.ts