-
Notifications
You must be signed in to change notification settings - Fork 0
353 lines (339 loc) · 12.1 KB
/
Copy pathci.yml
File metadata and controls
353 lines (339 loc) · 12.1 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
schedule:
- cron: '0 3 * * *'
jobs:
lint:
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install dependencies
run: npm ci --prefer-offline --no-audit
- name: Install Python dependencies
run: |
cd tywrap_ir
pip install -e .
- name: Lint
run: npm run lint
- name: Typecheck
run: npm run typecheck
- name: Type tests
run: npm run test:types
- name: Build
run: npm run build
test:
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [20, 22]
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: npm ci --prefer-offline --no-audit
- name: Install Python dependencies
run: |
cd tywrap_ir
pip install -e .
- name: Run tests
env:
NODE_OPTIONS: --expose-gc
TYWRAP_PERF_BUDGETS: '1'
run: ${{ (matrix.node-version == 22 && matrix.python-version == '3.11') && 'npm run test:coverage' || 'npm test' }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6
if: matrix.node-version == 22 && matrix.python-version == '3.11'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/lcov.info
fail_ci_if_error: false
python-suite-core:
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install suite core dependencies
env:
PIP_DISABLE_PIP_VERSION_CHECK: '1'
PIP_PROGRESS_BAR: 'off'
run: python -m pip install -r test/python/requirements-suite-core.txt
- name: Run suite core
run: python test/python/library_integration.py --suite core
- name: Run Python codec and frame tests
run: |
python -m pip install pytest
python -m pytest test/python/test_bridge_codec.py test/python/test_frame_codec.py
python-suite-data:
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Install suite data dependencies
env:
PIP_DISABLE_PIP_VERSION_CHECK: '1'
PIP_PROGRESS_BAR: 'off'
run: python -m pip install -r test/python/requirements-suite-data.txt
- name: Run suite data
run: python test/python/library_integration.py --suite data
living-app:
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Install Node dependencies
run: npm ci --prefer-offline --no-audit
- name: Create living-app virtualenv
run: |
python -m venv examples/living-app/.venv
./examples/living-app/.venv/bin/python -m pip install -U pip
- name: Install tywrap_ir + living-app Python dependencies
env:
PIP_DISABLE_PIP_VERSION_CHECK: '1'
PIP_PROGRESS_BAR: 'off'
run: |
./examples/living-app/.venv/bin/python -m pip install -e tywrap_ir
# Why: the living app defaults to Arrow mode; install pyarrow so CI exercises Arrow transport.
./examples/living-app/.venv/bin/python -m pip install -r examples/living-app/requirements-arrow.txt
- name: Run living-app smoke test
run: npm run example:living-app:smoke
- name: Run living-app JSON mode smoke test
run: npm run example:living-app:run:json
python-suite-full:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Install suite data dependencies
env:
PIP_DISABLE_PIP_VERSION_CHECK: '1'
PIP_PROGRESS_BAR: 'off'
run: python -m pip install -r test/python/requirements-suite-core.txt -r test/python/requirements-suite-data.txt -r test/python/requirements-suite-ml.txt
- name: Run suite full
run: python test/python/library_integration.py --suite all
codec-suite:
if: >-
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch' ||
github.event_name == 'push' ||
(github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'area:codec'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install dependencies
run: npm ci --prefer-offline --no-audit
- name: Install codec dependencies
env:
PIP_DISABLE_PIP_VERSION_CHECK: '1'
PIP_PROGRESS_BAR: 'off'
run: python -m pip install -r test/python/requirements-suite-ml.txt
- name: Run codec tests
env:
TYWRAP_CODEC_PYTHON: python
run: npm test -- test/runtime_codec_scientific.test.ts
os:
if: github.event_name != 'schedule'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install dependencies
run: npm ci --prefer-offline --no-audit
- name: Install Python dependencies
run: |
cd tywrap_ir
pip install -e .
- name: Run tests
env:
NODE_OPTIONS: --expose-gc
TYWRAP_PERF_BUDGETS: '1'
run: npm test
bun:
if: github.event_name != 'schedule'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: npm ci --prefer-offline --no-audit
- name: Install Python dependencies
run: |
cd tywrap_ir
pip install -e .
- name: Run Bun tests
run: bun run test:bun
node25-smoke:
# Closes #238: tywrap must install with no native build on newer Node.
# tree-sitter (native, no Node 25 prebuild) was removed; this guards the regression.
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 25
cache: npm
- name: Fresh install must not native-build
run: |
npm ci --prefer-offline --no-audit
if npm ls tree-sitter tree-sitter-python web-tree-sitter 2>/dev/null | grep -qiE 'tree-sitter'; then
echo "::error::tree-sitter dependency present — would break install on Node 25"; exit 1
fi
- name: Typecheck and build on Node 25
run: |
npm run typecheck
npm run build
data-plane-perf:
# #233 — gate the 0.8.0 large-payload / chunked-transport data plane.
# Dedicated job: pinned Node + Python, TYWRAP_PERF_BUDGETS=1,
# NODE_OPTIONS=--expose-gc, serial Vitest, NO coverage (instrumentation
# skews timings). Budgets are SAME-RUN RELATIVE inside the suite — the
# Apple-Silicon numbers in docs/perf-baselines.md are NOT used as CI truth.
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
# Pinned: perf comparisons need a stable runtime, not a moving matrix.
node-version: 22
cache: npm
- name: Setup Python
uses: actions/setup-python@v6
with:
# Pinned: the chunked-transport suite spawns runtime/python_bridge.py.
python-version: '3.11'
- name: Install dependencies
run: npm ci --prefer-offline --no-audit
- name: Build
run: npm run build
- name: Run data-plane perf gates (correctness-at-scale + budgets)
env:
NODE_OPTIONS: --expose-gc
# Dedicated flag so the gated suite runs ONLY here, not in the generic
# matrix test jobs (which set TYWRAP_PERF_BUDGETS for other budgets).
TYWRAP_DATA_PLANE_PERF: '1'
# Serial, no coverage. Covers the W7 gate plus the W4/W5 chunked
# large-payload integration suites so release gating includes them.
run: >-
npx vitest run --no-file-parallelism
test/data-plane-perf.test.ts
test/transport-chunking.test.ts
test/transport-request-chunking.test.ts
required:
if: ${{ always() && github.event_name != 'schedule' }}
runs-on: ubuntu-latest
needs:
- lint
- test
- python-suite-core
- python-suite-data
- living-app
- os
- bun
- node25-smoke
- data-plane-perf
steps:
- name: Check required jobs
run: |
fail=0
if [ "${{ needs.lint.result }}" != "success" ]; then echo "::error::lint: ${{ needs.lint.result }}"; fail=1; fi
if [ "${{ needs.test.result }}" != "success" ]; then echo "::error::test: ${{ needs.test.result }}"; fail=1; fi
if [ "${{ needs.python-suite-core.result }}" != "success" ]; then echo "::error::python-suite-core: ${{ needs.python-suite-core.result }}"; fail=1; fi
if [ "${{ needs.python-suite-data.result }}" != "success" ]; then echo "::error::python-suite-data: ${{ needs.python-suite-data.result }}"; fail=1; fi
if [ "${{ needs.living-app.result }}" != "success" ]; then echo "::error::living-app: ${{ needs.living-app.result }}"; fail=1; fi
if [ "${{ needs.os.result }}" != "success" ]; then echo "::error::os: ${{ needs.os.result }}"; fail=1; fi
if [ "${{ needs.bun.result }}" != "success" ]; then echo "::error::bun: ${{ needs.bun.result }}"; fail=1; fi
if [ "${{ needs.node25-smoke.result }}" != "success" ]; then echo "::error::node25-smoke: ${{ needs.node25-smoke.result }}"; fail=1; fi
if [ "${{ needs.data-plane-perf.result }}" != "success" ]; then echo "::error::data-plane-perf: ${{ needs.data-plane-perf.result }}"; fail=1; fi
if [ "$fail" -ne 0 ]; then exit 1; fi