Repository navigation
193 lines (186 loc) · 6.75 KB
/
Copy pathpython-tests.yml
File metadata and controls
193 lines (186 loc) · 6.75 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
name: Python - Tests
on:
pull_request:
branches: ["main", "feature*"]
paths:
- "python/**"
- ".github/workflows/python-tests.yml"
- "!python/AGENTS.md"
- "!python/**/AGENTS.md"
- "!python/.github/skills/*"
- "!python/.github/skills/**"
env:
# Configure a constant location for the uv cache
UV_CACHE_DIR: /tmp/.uv-cache
jobs:
devui-changes:
name: Detect DevUI Changes
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
devui: ${{ steps.filter.outputs.devui }}
steps:
- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
id: filter
with:
filters: |
devui:
- 'python/packages/devui/**'
- '.github/workflows/python-tests.yml'
devui-frontend:
name: DevUI Frontend Checks
needs: devui-changes
if: needs.devui-changes.outputs.devui == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
defaults:
run:
working-directory: python/packages/devui/frontend
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "24"
cache: npm
cache-dependency-path: python/packages/devui/frontend/package-lock.json
- name: Install frontend dependencies
run: npm ci
- name: Test file links
run: npm run test:file-urls
- name: Test tracing
run: npm run test:tracing
- name: Lint frontend
run: npm run lint
- name: Build frontend
run: npm run build
python-tests:
name: Python Tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
# todo: add macos-latest when problems are resolved
os: [ubuntu-latest, windows-latest]
# Full workspace setup still builds native packages slowly on Windows 3.15.
# The dedicated meta-package job below covers Windows installability on 3.14 and 3.15.
exclude:
- python-version: "3.15"
os: windows-latest
env:
UV_PYTHON: ${{ matrix.python-version }}
permissions:
contents: write
defaults:
run:
working-directory: python
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up python and install the project
id: python-setup
uses: ./.github/actions/python-setup
with:
python-version: ${{ matrix.python-version }}
os: ${{ runner.os }}
# Foundry Local requires Python 3.11-3.14; RedisVL still declares Python <3.15.
exclude-packages: ${{ matrix.python-version == '3.15' && 'agent-framework-redis agent-framework-foundry-local' || '' }}
env:
# Configure a constant location for the uv cache
UV_CACHE_DIR: /tmp/.uv-cache
# Unit tests
- name: Run all tests
run: uv run poe test -A --junitxml=pytest.xml
working-directory: ./python
- name: Run changed-package routing tests
run: >-
uv run --locked --group dev --group tool-runtime
python -m pytest scripts/tests/test_run_tasks_in_changed_packages.py --import-mode=importlib -q
working-directory: ./python
# Surface failing tests
- name: Surface failing tests
if: always()
uses: pmeier/pytest-results-action@fdc7f18d9934e38aca411ca9557e6577bd25ca9c # v0.9.0
with:
path: ./python/pytest.xml
summary: true
display-options: fEX
fail-on-empty: false
title: Test results
python-meta-package-install:
name: Python Meta Install (${{ matrix.python-version }}, Windows)
runs-on: windows-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
python-version: ["3.14", "3.15"]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up uv
uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
with:
version-file: "python/pyproject.toml"
enable-cache: true
cache-suffix: windows-meta-${{ matrix.python-version }}
- name: Create the Python environment
shell: pwsh
run: |
uv venv --python "${{ matrix.python-version }}" --seed .meta-venv
& ".meta-venv\Scripts\python.exe" --version
- name: Build release wheelhouse
shell: bash
run: |
set -euo pipefail
mkdir -p wheelhouse
uv build \
--directory python \
--all-packages \
--wheel \
--no-build-logs \
--no-create-gitignore \
--out-dir "${{ github.workspace }}/wheelhouse"
uv build \
--directory python \
--wheel \
--no-build-logs \
--no-create-gitignore \
--out-dir "${{ github.workspace }}/wheelhouse"
- name: Resolve the end-user install
timeout-minutes: 6
shell: pwsh
env:
PIP_DISABLE_PIP_VERSION_CHECK: "1"
run: |
$python = ".meta-venv\Scripts\python.exe"
& $python -m pip install --upgrade pip
$version = & $python -c "import tomllib; print(tomllib.load(open('python/pyproject.toml', 'rb'))['project']['version'])"
$stopwatch = [System.Diagnostics.Stopwatch]::StartNew()
& $python -m pip install `
--dry-run `
--ignore-installed `
--find-links wheelhouse `
--report "pip-resolution-${{ matrix.python-version }}.json" `
"agent-framework==$version" `
azure-identity
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
$stopwatch.Stop()
$seconds = [math]::Round($stopwatch.Elapsed.TotalSeconds, 2)
"Pip resolution completed in $seconds seconds." | Tee-Object -FilePath $env:GITHUB_STEP_SUMMARY -Append
if ($stopwatch.Elapsed.TotalSeconds -gt 180) {
throw "Pip dependency resolution exceeded the 180-second budget."
}
- name: Install and import the meta package
timeout-minutes: 10
shell: pwsh
env:
PIP_DISABLE_PIP_VERSION_CHECK: "1"
run: |
$python = ".meta-venv\Scripts\python.exe"
$version = & $python -c "import tomllib; print(tomllib.load(open('python/pyproject.toml', 'rb'))['project']['version'])"
& $python -m pip install --find-links wheelhouse "agent-framework==$version" azure-identity
& $python -c "import agent_framework; import azure.identity"