-
Notifications
You must be signed in to change notification settings - Fork 7
161 lines (142 loc) · 5.12 KB
/
Copy pathci_python.yml
File metadata and controls
161 lines (142 loc) · 5.12 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
# 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
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 }})
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 }}
# PyYAML is not a project dependency, but test_hermes_config_mapping
# imports it to read Hermes Agent config fixtures, so install it for the tests.
- name: Build SDK with native extension
run: |
uv venv --python "${UV_PYTHON:-${{ matrix.python-version }}}" .venv
uv sync --group test --no-group dev --extra claude --extra codex --extra deepagents ${{ matrix.python-version != '3.11' && '--extra harbor' || '' }} ${{ matrix.python-version != '3.14' && '--extra hermes-agent' || '' }} --extra relay --extra runtime
- name: Run pytest
run: |
set -euo pipefail
just test-python
build-wheels:
name: Build wheels (${{ matrix.platform }})
needs: [test]
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: 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: Upload wheels
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: python-wheels-${{ matrix.platform }}
path: dist/*.whl
if-no-files-found: error