-
Notifications
You must be signed in to change notification settings - Fork 4.5k
323 lines (311 loc) · 12.4 KB
/
Copy pathtests.yml
File metadata and controls
323 lines (311 loc) · 12.4 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
name: Tests
on:
push:
branches:
- main
pull_request:
# All PRs, including stacked PRs
permissions:
contents: read
env:
UV_FROZEN: "1"
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Detect code changes
id: changes
run: ./.github/scripts/detect-changes.sh code "${{ github.event.pull_request.base.sha || github.event.before }}" "${{ github.sha }}"
- name: Setup uv
if: steps.changes.outputs.run == 'true'
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # setup-uv v9.0.0; uv 0.11.14
with:
version: "0.11.14"
enable-cache: true
prune-cache: true
- name: Install dependencies
if: steps.changes.outputs.run == 'true'
run: make sync
- name: Verify formatting
if: steps.changes.outputs.run == 'true'
run: make format-check
- name: Run lint
if: steps.changes.outputs.run == 'true'
run: make lint
- name: Skip lint
if: steps.changes.outputs.run != 'true'
run: echo "Skipping lint for non-code changes."
typecheck:
runs-on: ubuntu-latest
timeout-minutes: 12
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Detect code changes
id: changes
run: ./.github/scripts/detect-changes.sh code "${{ github.event.pull_request.base.sha || github.event.before }}" "${{ github.sha }}"
- name: Setup uv
if: steps.changes.outputs.run == 'true'
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # setup-uv v9.0.0; uv 0.11.14
with:
version: "0.11.14"
enable-cache: true
prune-cache: true
- name: Restore mypy cache
if: steps.changes.outputs.run == 'true'
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .mypy_cache
key: mypy-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('uv.lock', 'pyproject.toml', 'Makefile') }}-${{ github.sha }}
restore-keys: |
mypy-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('uv.lock', 'pyproject.toml', 'Makefile') }}-
- name: Install dependencies
if: steps.changes.outputs.run == 'true'
run: make sync
- name: Run typecheck
if: steps.changes.outputs.run == 'true'
run: make typecheck
- name: Skip typecheck
if: steps.changes.outputs.run != 'true'
run: echo "Skipping typecheck for non-code changes."
tests:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
env:
OPENAI_API_KEY: fake-for-tests
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Detect code changes
id: changes
run: ./.github/scripts/detect-changes.sh code "${{ github.event.pull_request.base.sha || github.event.before }}" "${{ github.sha }}"
- name: Setup uv
if: steps.changes.outputs.run == 'true'
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # setup-uv v9.0.0; uv 0.11.14
with:
version: "0.11.14"
enable-cache: true
prune-cache: true
python-version: ${{ matrix.python-version }}
- name: Install dependencies
if: steps.changes.outputs.run == 'true'
run: make sync
- name: Run tests with coverage
if: steps.changes.outputs.run == 'true' && matrix.python-version == '3.12'
run: make coverage
- name: Run tests
if: steps.changes.outputs.run == 'true' && matrix.python-version != '3.12'
run: make tests
- name: Run async teardown stability tests
if: steps.changes.outputs.run == 'true' && (matrix.python-version == '3.10' || matrix.python-version == '3.14')
run: make tests-asyncio-stability
- name: Skip tests
if: steps.changes.outputs.run != 'true'
run: echo "Skipping tests for non-code changes."
mcp-v1-compat:
runs-on: ubuntu-latest
timeout-minutes: 5
env:
OPENAI_API_KEY: fake-for-tests
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Detect code changes
id: changes
run: ./.github/scripts/detect-changes.sh code "${{ github.event.pull_request.base.sha || github.event.before }}" "${{ github.sha }}"
- name: Setup uv
if: steps.changes.outputs.run == 'true'
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # setup-uv v9.0.0; uv 0.11.14
with:
version: "0.11.14"
enable-cache: true
prune-cache: true
python-version: "3.12"
- name: Run packaged MCP v1 compatibility tests
if: steps.changes.outputs.run == 'true'
run: make integration-tests-mcp-v1
- name: Skip MCP v1 compatibility tests
if: steps.changes.outputs.run != 'true'
run: echo "Skipping MCP v1 compatibility tests for non-code changes."
packaged-contract:
needs: prospective-release-contract
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.14"
env:
OPENAI_AGENTS_INTEGRATION_PYTHON: ${{ matrix.python-version }}
OPENAI_API_KEY: fake-for-tests
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Detect code changes
id: changes
run: ./.github/scripts/detect-changes.sh code "${{ github.event.pull_request.base.sha || github.event.before }}" "${{ github.sha }}"
- name: Setup uv
if: steps.changes.outputs.run == 'true'
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # setup-uv v9.0.0; uv 0.11.14
with:
version: "0.11.14"
enable-cache: true
prune-cache: true
python-version: ${{ matrix.python-version }}
- name: Download prospective release contract
if: steps.changes.outputs.run == 'true'
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: prospective-release-contract
path: .tmp
- name: Run packaged and prospective compatibility contracts
if: steps.changes.outputs.run == 'true'
env:
OPENAI_AGENTS_PROSPECTIVE_RELEASE_CONTRACT: ${{ github.workspace }}/.tmp/prospective_released_api_contract.json
run: make integration-tests-prospective-contract
- name: Skip packaged compatibility contracts
if: steps.changes.outputs.run != 'true'
run: echo "Skipping packaged compatibility contracts for non-code changes."
packaged-contract-windows:
needs: prospective-release-contract
runs-on: windows-latest
timeout-minutes: 15
env:
OPENAI_AGENTS_INTEGRATION_PYTHON: "3.13"
OPENAI_API_KEY: fake-for-tests
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Detect code changes
id: changes
shell: bash
run: ./.github/scripts/detect-changes.sh code "${{ github.event.pull_request.base.sha || github.event.before }}" "${{ github.sha }}"
- name: Setup uv
if: steps.changes.outputs.run == 'true'
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # setup-uv v9.0.0; uv 0.11.14
with:
version: "0.11.14"
enable-cache: true
prune-cache: true
python-version: "3.13"
- name: Download prospective release contract
if: steps.changes.outputs.run == 'true'
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: prospective-release-contract
path: .tmp
- name: Run Windows prospective contract smoke test
if: steps.changes.outputs.run == 'true'
env:
OPENAI_AGENTS_PROSPECTIVE_RELEASE_CONTRACT: ${{ github.workspace }}/.tmp/prospective_released_api_contract.json
run: uv run python .github/scripts/run_integration_tests.py --profile prospective-platform
- name: Skip Windows prospective contract smoke test
if: steps.changes.outputs.run != 'true'
run: echo "Skipping Windows prospective contract smoke test for non-code changes."
prospective-release-contract:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
OPENAI_AGENTS_INTEGRATION_PYTHON: "3.12"
OPENAI_API_KEY: fake-for-tests
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Detect code changes
id: changes
run: ./.github/scripts/detect-changes.sh code "${{ github.event.pull_request.base.sha || github.event.before }}" "${{ github.sha }}"
- name: Setup uv
if: steps.changes.outputs.run == 'true'
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # setup-uv v9.0.0; uv 0.11.14
with:
version: "0.11.14"
enable-cache: true
prune-cache: true
python-version: "3.12"
- name: Install all optional dependencies
if: steps.changes.outputs.run == 'true'
run: make sync
- name: Validate source and generate prospective release contract
if: steps.changes.outputs.run == 'true'
run: make prepare-prospective-released-api-contract
- name: Upload prospective release contract
if: steps.changes.outputs.run == 'true'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: prospective-release-contract
path: .tmp/prospective_released_api_contract.json
if-no-files-found: error
include-hidden-files: true
retention-days: 1
- name: Skip prospective release contract
if: steps.changes.outputs.run != 'true'
run: echo "Skipping prospective release contract for non-code changes."
tests-windows:
runs-on: windows-latest
timeout-minutes: 10
env:
OPENAI_API_KEY: fake-for-tests
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Detect code changes
id: changes
shell: bash
run: ./.github/scripts/detect-changes.sh code "${{ github.event.pull_request.base.sha || github.event.before }}" "${{ github.sha }}"
- name: Setup uv
if: steps.changes.outputs.run == 'true'
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # setup-uv v9.0.0; uv 0.11.14
with:
version: "0.11.14"
enable-cache: true
prune-cache: true
python-version: "3.13"
- name: Install dependencies
if: steps.changes.outputs.run == 'true'
run: uv sync --all-extras --all-packages --group dev
- name: Run tests
if: steps.changes.outputs.run == 'true'
run: uv run pytest
- name: Skip tests
if: steps.changes.outputs.run != 'true'
run: echo "Skipping tests for non-code changes."
build-docs:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
OPENAI_API_KEY: fake-for-tests
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Detect docs changes
id: changes
run: ./.github/scripts/detect-changes.sh docs "${{ github.event.pull_request.base.sha || github.event.before }}" "${{ github.sha }}"
- name: Setup uv
if: steps.changes.outputs.run == 'true'
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # setup-uv v9.0.0; uv 0.11.14
with:
version: "0.11.14"
enable-cache: true
prune-cache: true
- name: Install dependencies
if: steps.changes.outputs.run == 'true'
run: make sync
- name: Build docs
if: steps.changes.outputs.run == 'true'
run: make build-docs
- name: Skip docs build
if: steps.changes.outputs.run != 'true'
run: echo "Skipping docs build for non-docs changes."