-
Notifications
You must be signed in to change notification settings - Fork 33
365 lines (312 loc) · 12 KB
/
Copy pathci.yml
File metadata and controls
365 lines (312 loc) · 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
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
name: CI
on:
workflow_dispatch:
push:
branches: [main, beta]
pull_request:
branches: [main, beta]
## Stop CI from injecting fake "installs" into the telemetry dashboard or
## burning streaming-insert quota on the backend. Opt-out is fully
## side-effect-free in the collector (no UUID generated, no worker
## thread, no _send), so the test/runtime behavior under this flag
## matches a real opted-out end-user install. Mirrored in script/ci-*
## shell scripts for any path that doesn't inherit this env.
env:
GODOT_AI_DISABLE_TELEMETRY: "true"
## CI only reads the repo — no job here writes to it, so drop the default
## token down to read-only (third-party actions run with this grant too).
permissions:
contents: read
jobs:
python-tests:
name: Python ${{ matrix.python-version }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Deliberately Linux-only: the Python server is pure-async with no
# platform-specific code. Real OS regressions are caught by the
# release-smoke and godot-tests jobs, which still run on all 3 OSes.
# See issue #35 before restoring the full matrix.
os: [ubuntu-latest]
python-version: ["3.11", "3.13"]
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Run tests
run: pytest -v
- name: Run tests with coverage
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13'
run: pytest --cov=godot_ai --cov-report=xml -v
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13'
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6
with:
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
- name: Lint
run: ruff check src/ tests/
release-smoke:
name: Release smoke / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.13"
cache: pip
cache-dependency-path: pyproject.toml
- name: Build sdist and wheel
run: |
python -m pip install --upgrade pip build
python -m build
- name: Install built wheel in a clean venv
shell: bash
run: |
venv="${RUNNER_TEMP}/smoke-venv"
python -m venv "$venv"
if [ -x "$venv/bin/python" ]; then
PY="$venv/bin/python"
GODOT_AI="$venv/bin/godot-ai"
else
PY="$venv/Scripts/python.exe"
GODOT_AI="$venv/Scripts/godot-ai.exe"
fi
# Use `python -m pip` rather than the pip executable — on Windows,
# pip.exe can't replace itself mid-upgrade, which breaks smoke tests.
"$PY" -m pip install dist/*.whl
"$GODOT_AI" --version
"$GODOT_AI" --help
- name: Install built sdist in a clean venv
shell: bash
run: |
venv="${RUNNER_TEMP}/smoke-sdist-venv"
python -m venv "$venv"
if [ -x "$venv/bin/python" ]; then
PY="$venv/bin/python"
GODOT_AI="$venv/bin/godot-ai"
else
PY="$venv/Scripts/python.exe"
GODOT_AI="$venv/Scripts/godot-ai.exe"
fi
"$PY" -m pip install dist/*.tar.gz
"$GODOT_AI" --version
- name: Upload build artifacts
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: dist
path: dist/
godot-tests:
name: Godot tests / ${{ matrix.label }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
label: Linux
godot-version: "4.6.2"
- os: macos-latest
label: macOS
godot-version: "4.6.2"
- os: windows-latest
label: Windows
godot-version: "4.6.2"
## 4.3 Linux canary — README advertises "Godot 4.3+" support and
## #476's parse-cascade regression went unnoticed for 24 days
## because every CI run was on 4.6.2. Phase 1 of #477: one cheap
## Linux canary to catch the same class of regression in future.
## Phase 2 (full 3-OS 4.3 coverage) is deferred.
- os: ubuntu-latest
label: Linux (Godot 4.3)
godot-version: "4.3.0"
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Build plugin link
shell: bash
run: bash script/verify-worktree
- uses: chickensoft-games/setup-godot@f166999204a4f2722c6fe042fbaa3b3ea0d9c789 # v2
with:
version: ${{ matrix.godot-version }}
use-dotnet: false
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.13"
cache: pip
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Self-update forward upgrade regression
shell: bash
timeout-minutes: 3
run: GODOT_BIN=godot pytest -q tests/integration/test_self_update_upgrade_paths.py
- name: Start MCP server
shell: bash
run: bash script/ci-start-server
- name: Import and validate GDScript
shell: bash
timeout-minutes: 3
run: |
godot --headless --path test_project --import > godot-import.log 2>&1 || true
bash script/ci-check-gdscript godot-import.log
- name: Start Godot editor (headless)
shell: bash
run: GODOT_AI_ALLOW_HEADLESS=1 godot --headless --path test_project --editor > godot-editor.log 2>&1 &
- name: Run handler tests
shell: bash
timeout-minutes: 3
run: bash script/ci-godot-tests
- name: Reload smoke test
shell: bash
timeout-minutes: 2
## On the 4.3 canary, skip only the post-churn test_run step:
## GDScript exec is slow enough on 4.3 that the suite outruns
## mcp_call's 30s curl timeout, even though the 10 reload
## iterations themselves all pass. The reload-churn mechanism
## is the regression class this smoke guards, so the canary
## still has value.
env:
SKIP_POSTCHURN_TEST_RUN: ${{ matrix.godot-version == '4.3.0' && '1' || '0' }}
run: bash script/ci-reload-test
- name: Quit smoke test
shell: bash
timeout-minutes: 2
run: bash script/ci-quit-test
- name: Dump Godot editor log on failure
if: failure()
shell: bash
run: |
echo "===== godot-editor.log (last 500 lines) ====="
tail -n 500 godot-editor.log || echo "(log not found)"
echo "===== godot-import.log (last 200 lines) ====="
tail -n 200 godot-import.log || echo "(log not found)"
# Verifies the plugin's automatic kill+respawn flow when port 8000 is held
# by a stale godot-ai server (different version). The unit tests in
# test_plugin_lifecycle.gd mock every OS interaction; this is the only
# automated job that exercises the real per-OS branded-kill machinery
# (PowerShell on Windows, /proc on Linux, ps on macOS). Replaces the
# manual operator runs of `script/manual-orphan-test`.
stale-server-smoke:
name: Stale server smoke / ${{ matrix.label }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
label: Linux
- os: macos-latest
label: macOS
- os: windows-latest
label: Windows
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Build plugin link
shell: bash
run: bash script/verify-worktree
- uses: chickensoft-games/setup-godot@f166999204a4f2722c6fe042fbaa3b3ea0d9c789 # v2
with:
version: 4.6.2
use-dotnet: false
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.13"
cache: pip
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Import and validate GDScript
shell: bash
timeout-minutes: 3
run: |
godot --headless --path test_project --import > godot-import.log 2>&1 || true
bash script/ci-check-gdscript godot-import.log
- name: Run stale-server smoke
shell: bash
timeout-minutes: 3
run: python script/ci-stale-server-smoke --log-dir .
- name: Dump editor log on failure
if: failure()
shell: bash
run: |
echo "===== godot-stale-smoke.log (last 500 lines) ====="
tail -n 500 godot-stale-smoke.log || echo "(log not found)"
echo "===== godot-import.log (last 200 lines) ====="
tail -n 200 godot-import.log || echo "(log not found)"
# Separate job from godot-tests: the capture smoke test needs a real
# rendering driver (null RenderingDevice in --headless produces empty
# framebuffers) and a display server. Linux uses xvfb-run; macOS and
# Windows CI runners have a real graphics stack and run the editor
# windowed. This job verifies editor_screenshot(source="game") round-
# trips real game pixels — see closes #72.
game-capture-smoke:
name: Game capture smoke / ${{ matrix.label }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
label: Linux
- os: macos-latest
label: macOS
- os: windows-latest
label: Windows
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Build plugin link
shell: bash
run: bash script/verify-worktree
- uses: chickensoft-games/setup-godot@f166999204a4f2722c6fe042fbaa3b3ea0d9c789 # v2
with:
version: 4.6.2
use-dotnet: false
- name: Install xvfb
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update && sudo apt-get install -y xvfb
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.13"
cache: pip
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Start MCP server
shell: bash
run: bash script/ci-start-server
- name: Import and validate GDScript
shell: bash
timeout-minutes: 3
run: |
godot --headless --path test_project --import > godot-import.log 2>&1 || true
bash script/ci-check-gdscript godot-import.log
- name: Start Godot editor (Linux / xvfb)
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
xvfb-run -a --server-args="-screen 0 1280x720x24" \
godot --rendering-driver opengl3 --path test_project --editor &
- name: Start Godot editor (windowed)
if: matrix.os != 'ubuntu-latest'
shell: bash
run: godot --path test_project --editor &
- name: Run capture smoke test
timeout-minutes: 5
shell: bash
run: python script/ci-game-capture-smoke