Repository navigation
497 lines (429 loc) · 18.5 KB
/
Copy pathci_python.yml
File metadata and controls
497 lines (429 loc) · 18.5 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
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
name: Python
on:
workflow_call:
inputs:
ref:
description: 'The Git ref to check out; defaults to the triggering commit'
required: false
default: ''
type: string
ref_name:
description: 'The effective ref name; defaults to the triggering ref name'
required: false
default: ''
type: string
ref_type:
description: 'The effective ref type; defaults to the triggering ref type'
required: false
default: ''
type: string
skip_tests:
description: 'Skip the Python test matrix and only build wheels'
required: false
default: false
type: boolean
pull_request:
push:
branches: [main]
tags: ['*']
concurrency:
group: ci-python-${{ inputs.ref || github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
test:
name: Test (Python ${{ matrix.python-version }}, ${{ matrix.platform }})
if: ${{ (inputs.ref_type || github.ref_type) != 'tag' && !inputs.skip_tests }}
strategy:
fail-fast: false
matrix:
platform: [linux-amd64, linux-arm64, macos-arm64, windows-amd64]
python-version: ['3.11', '3.12', '3.13', '3.14']
include:
- platform: linux-amd64
runner: ubuntu-24.04
- platform: linux-arm64
runner: ubuntu-24.04-arm
- platform: macos-arm64
runner: macos-15
- platform: windows-amd64
runner: windows-2022
runs-on: ${{ matrix.runner }}
timeout-minutes: 30
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
ref: ${{ inputs.ref || github.sha }}
# Rust is needed both to build the native extension (maturin backend) and
# because the CLI-backed smokes shell out to `cargo run -p nemo-fabric-cli`.
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
with:
toolchain: stable
cache: false
- name: Install just
uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: just@1.50.0
- name: Set up uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8
- name: Cache cargo build
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
shared-key: fabric-rust-${{ runner.os }}-${{ runner.arch }}
- name: Create virtual environment
run: |
uv venv --python "${UV_PYTHON:-${{ matrix.python-version }}}" .venv
# Exercise the supported root adapter and harness compositions. The
# adapter-tests group also keeps local test dependencies independently
# installable for leaf adapter development.
- name: Build SDK with native extension
run: |
uv sync --no-default-groups --group adapter-tests --group collector --group test --extra claude --extra codex --extra deepagents --extra mini-swe-agent --extra openclaw --extra openhands --extra remote-agent ${{ (matrix.python-version == '3.12' || matrix.python-version == '3.13') && '--extra nooa' || '' }} ${{ matrix.python-version != '3.11' && '--extra harbor' || '' }} --extra relay
- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: 24
cache: npm
cache-dependency-path: adapters/typescript/package-lock.json
- name: Build Pi and Kiro adapters for Python health checks
run: |
just install-typescript-contract
npm ci --prefix adapters/typescript --workspace nemo-fabric-adapters-pi \
--workspace nemo-fabric-adapters-kiro --include-workspace-root --ignore-scripts
npm run build --prefix adapter-contract/typescript
npm run build --prefix adapters/typescript --workspace nemo-fabric-adapters-common
npm run build --prefix adapters/typescript --workspace nemo-fabric-adapters-pi
npm run build --prefix adapters/typescript --workspace nemo-fabric-adapters-kiro
- name: Run pytest
run: |
set -euo pipefail
just --set no_uv true test-python
- name: Test Kiro health with the pinned native CLI
if: matrix.platform == 'linux-amd64' && matrix.python-version == '3.12'
env:
RUN_FABRIC_KIRO_NATIVE_HEALTH: '1'
run: |
set -euo pipefail
kiro_root="$RUNNER_TEMP/fabric-kiro-native"
mkdir -p "$kiro_root"
curl --fail --location --retry 3 \
https://prod.download.cli.kiro.dev/stable/2.34.2/kirocli-x86_64-linux.tar.xz \
--output "$kiro_root/kiro.tar.xz"
echo "960175e0fb905379014b0fecd9a5021549917e514cdb10ce53e6024c6cc39e4f $kiro_root/kiro.tar.xz" | sha256sum --check
tar --extract --file "$kiro_root/kiro.tar.xz" --directory "$kiro_root"
export PATH="$kiro_root/kirocli/bin:$PATH"
uv run --no-sync pytest tests/e2e/test_kiro_native_health.py -q
- name: Test OpenHands condensation with the SDK
if: matrix.platform == 'linux-amd64' && matrix.python-version == '3.12'
run: |
uv pip install "openhands-sdk==1.50.0" "openhands-tools==1.50.0"
uv run --no-sync pytest tests/adapters/test_openhands.py -k test_invoke_condenses_history_and_counts_summary_usage -q
relay-cli:
name: Relay CLI ${{ matrix.relay-cli-version }} (Python 3.12, linux-amd64)
# Cover supported CLI releases while keeping the Python SDK on its locked version.
strategy:
fail-fast: false
matrix:
relay-cli-version: ["0.9.0", "0.10.0", "0.10.1", "0.11.0"]
if: ${{ (inputs.ref_type || github.ref_type) != 'tag' && !inputs.skip_tests }}
runs-on: ubuntu-24.04
timeout-minutes: 30
permissions:
contents: read
env:
RELAY_CLI_VERSION: ${{ matrix.relay-cli-version }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
ref: ${{ inputs.ref || github.sha }}
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
with:
toolchain: stable
cache: false
- name: Install just
uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: just@1.50.0
- name: Set up uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8
- name: Cache cargo build
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
shared-key: fabric-rust-${{ runner.os }}-${{ runner.arch }}
- name: Create virtual environment
run: uv venv --python 3.12 .venv
- name: Build SDK with native extension
run: |
uv sync --no-default-groups --group adapter-tests --group collector --group test --extra claude --extra codex --extra deepagents --extra mini-swe-agent --extra openclaw --extra openhands --extra remote-agent --extra nooa --extra harbor --extra relay
- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: 24
cache: npm
cache-dependency-path: adapters/typescript/package-lock.json
- name: Build Pi and Kiro adapters for Python health checks
run: |
just install-typescript-contract
npm ci --prefix adapters/typescript --workspace nemo-fabric-adapters-pi \
--workspace nemo-fabric-adapters-kiro --include-workspace-root --ignore-scripts
npm run build --prefix adapter-contract/typescript
npm run build --prefix adapters/typescript --workspace nemo-fabric-adapters-common
npm run build --prefix adapters/typescript --workspace nemo-fabric-adapters-pi
npm run build --prefix adapters/typescript --workspace nemo-fabric-adapters-kiro
- name: Install Relay CLI ${{ env.RELAY_CLI_VERSION }}
run: uv pip install --python .venv/bin/python "nemo-relay-cli-bin==${RELAY_CLI_VERSION}"
- name: Run pytest
run: |
set -euo pipefail
just --set no_uv true test-python
hermes:
name: Hermes adapter (${{ matrix.hermes.version }}, Relay ${{ matrix.hermes.relay }}, Python 3.14)
if: ${{ (inputs.ref_type || github.ref_type) != 'tag' && !inputs.skip_tests }}
runs-on: ubuntu-24.04
timeout-minutes: 30
permissions:
contents: read
strategy:
fail-fast: false
matrix:
hermes:
- version: v0.22.5
commit: bf0203a794a07aac3ff764972ab9087baa4e4f4e
relay: "0.10"
- version: v0.22.7
commit: b200f5bc60e31588ba2cb60e288029c4a54ba5fa
relay: "0.11"
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
ref: ${{ inputs.ref || github.sha }}
- name: Checkout Hermes Agent ${{ matrix.hermes.version }}
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
repository: NousResearch/hermes-agent
ref: ${{ matrix.hermes.commit }}
path: external/hermes-agent
persist-credentials: false
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
with:
toolchain: stable
cache: false
- name: Install just
uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: just@1.50.0
- name: Set up uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8
- name: Test ordinary Hermes adapter behavior
run: just --set hermes_commit '${{ matrix.hermes.commit }}' test-hermes
opencode-e2e:
name: OpenCode E2E
if: ${{ (inputs.ref_type || github.ref_type) != 'tag' && !inputs.skip_tests }}
runs-on: ubuntu-24.04
timeout-minutes: 20
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
ref: ${{ inputs.ref || github.sha }}
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
with:
toolchain: stable
cache: false
- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: 24
cache: npm
cache-dependency-path: adapters/typescript/package-lock.json
- name: Set up Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: 1.4.2
- name: Install just
uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: just@1.50.0
- name: Set up uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8
- name: Create virtual environment
run: uv venv --python 3.12 .venv
- name: Install OpenCode adapter dependencies
run: |
just install-typescript-opencode
npm run build --prefix adapter-contract/typescript
npm run build --prefix adapters/typescript --workspace nemo-fabric-adapters-common
npm run build --prefix adapters/typescript --workspace nemo-fabric-adapters-opencode
- name: Run deterministic OpenCode E2E
run: |
uv sync --no-default-groups --group test
uv run --no-sync pytest tests/e2e/test_opencode.py -k local_openai_compatible -q
cline-e2e:
name: Cline E2E
if: ${{ (inputs.ref_type || github.ref_type) != 'tag' && !inputs.skip_tests }}
runs-on: ubuntu-24.04
timeout-minutes: 20
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
ref: ${{ inputs.ref || github.sha }}
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
with:
toolchain: stable
cache: false
- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: 24
cache: npm
cache-dependency-path: adapters/typescript/package-lock.json
- name: Install just
uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: just@1.50.0
- name: Set up uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8
- name: Create virtual environment
run: uv venv --python 3.12 .venv
- name: Install Cline adapter and caller-owned SDK
run: |
just install-typescript-cline
# Cline is caller-managed, so this intentionally tests the exact supported
# SDK release with its current transitive graph outside NeMo Fabric's lockfile.
npm install --prefix adapters/typescript --workspace nemo-fabric-adapters-cline --include-workspace-root --no-save --package-lock=false --ignore-scripts --no-audit --no-fund @cline/sdk@0.0.83
npm run build --prefix adapter-contract/typescript
npm run build --prefix adapters/typescript --workspace nemo-fabric-adapters-common
npm run build --prefix adapters/typescript --workspace nemo-fabric-adapters-cline
- name: Run deterministic Cline E2E
run: |
uv sync --frozen --no-default-groups --group test --no-sources-package hermes-agent
node --test adapters/typescript/cline/test/native-health.mjs
uv run --no-sync pytest tests/e2e/test_cline.py -k 'plans_diagnoses_runs_and_isolates_sessions or health_does_not_wait_for_the_first_model_request' -q
qwen-e2e:
name: Qwen Code E2E
if: ${{ (inputs.ref_type || github.ref_type) != 'tag' && !inputs.skip_tests }}
runs-on: ubuntu-24.04
timeout-minutes: 20
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
ref: ${{ inputs.ref || github.sha }}
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
with:
toolchain: stable
cache: false
- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: 24
cache: npm
cache-dependency-path: adapters/typescript/package-lock.json
- name: Install just
uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: just@1.50.0
- name: Set up uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8
- name: Create virtual environment
run: uv venv --python 3.12 .venv
- name: Install Qwen adapter dependencies
run: |
just install-typescript-qwen
npm run build --prefix adapter-contract/typescript
npm run build --prefix adapters/typescript --workspace nemo-fabric-adapters-common
npm run build --prefix adapters/typescript --workspace nemo-fabric-adapters-qwen
- name: Run deterministic Qwen E2E
run: |
uv sync --frozen --no-default-groups --group test --no-sources-package hermes-agent
uv run --no-sync pytest tests/e2e/test_qwen.py tests/e2e/test_qwen_checks.py -q
build-wheels:
name: Build wheels (${{ matrix.platform }})
needs: [test, relay-cli, hermes]
if: ${{ always() && (needs.test.result == 'success' || needs.test.result == 'skipped') && (needs.relay-cli.result == 'success' || needs.relay-cli.result == 'skipped') && (needs.hermes.result == 'success' || needs.hermes.result == 'skipped') }}
strategy:
fail-fast: false
matrix:
include:
- platform: linux-amd64
runner: ubuntu-24.04
- platform: linux-arm64
runner: ubuntu-24.04-arm
- platform: macos-arm64
runner: macos-15
- platform: windows-amd64
runner: windows-2022
runs-on: ${{ matrix.runner }}
timeout-minutes: 30
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
fetch-depth: 0
ref: ${{ inputs.ref || github.sha }}
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@150fca883cd4034361b621bd4e6a9d34e5143606 # v1.15.4
with:
toolchain: stable
cache: false
- name: Install just
uses: taiki-e/install-action@c070f87102a1c75b3183910f391c1cb887fe13c8 # v2.77.6
with:
tool: just@1.50.0
- name: Set up uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8
with:
enable-cache: true
cache-dependency-glob: uv.lock
- name: Create virtual environment
run: uv venv --python "${UV_PYTHON:-${{ 3.12 }}}" .venv
- name: Set version from tag
if: ${{ (inputs.ref_type || github.ref_type) == 'tag' }}
env:
RELEASE_VERSION: ${{ inputs.ref_name || github.ref_name }}
run: just set-version "$RELEASE_VERSION"
- name: Cache cargo build
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
shared-key: fabric-python-wheels-${{ runner.os }}-${{ runner.arch }}
- name: Build wheels
run: just wheels
- name: Validate wheel licenses
run: just check-wheel-licenses
- name: Upload wheels
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: python-wheels-${{ matrix.platform }}
path: dist/*.whl
if-no-files-found: error