-
Notifications
You must be signed in to change notification settings - Fork 0
397 lines (354 loc) · 16.1 KB
/
Copy pathtest.yml
File metadata and controls
397 lines (354 loc) · 16.1 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
name: Test
on:
pull_request:
permissions:
contents: read
jobs:
smoke-test:
name: Headless smoke test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: ./.github/actions/load-godot-toolchain
id: godot-config
- name: Download Godot
shell: bash
run: |
set -euo pipefail
mkdir -p .tools
curl -fsSL "${{ steps.godot-config.outputs.linux_url }}" -o /tmp/godot_linux.zip
printf '%s %s\n' "${{ steps.godot-config.outputs.linux_sha256 }}" /tmp/godot_linux.zip | shasum -a 256 -c -
unzip -oq /tmp/godot_linux.zip -d .tools/
chmod +x .tools/Godot_v${{ steps.godot-config.outputs.version }}-${{ steps.godot-config.outputs.status }}_linux.x86_64
- name: Verify Godot binary
shell: bash
run: |
set -euo pipefail
chmod +x .tools/Godot_v${{ steps.godot-config.outputs.version }}-${{ steps.godot-config.outputs.status }}_linux.x86_64
./.tools/Godot_v${{ steps.godot-config.outputs.version }}-${{ steps.godot-config.outputs.status }}_linux.x86_64 --version
- name: Install Godot system dependencies
shell: bash
run: |
set -euo pipefail
sudo apt-get update && sudo apt-get install -y libfontconfig1
- name: Run headless smoke test
shell: bash
run: |
set -euo pipefail
timeout 15 ./.tools/Godot_v${{ steps.godot-config.outputs.version }}-${{ steps.godot-config.outputs.status }}_linux.x86_64 --headless --path . --fixed-fps 60 --quit-after 300 > smoke.log 2>&1
if grep -E "SCRIPT ERROR|ERROR:" smoke.log; then
echo "Smoke test logged an engine/script error" >&2
cat smoke.log >&2
exit 1
fi
script-tests:
name: Script test suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: ./.github/actions/load-godot-toolchain
id: godot-config
- name: Download Godot
shell: bash
run: |
set -euo pipefail
mkdir -p .tools
curl -fsSL "${{ steps.godot-config.outputs.linux_url }}" -o /tmp/godot_linux.zip
printf '%s %s\n' "${{ steps.godot-config.outputs.linux_sha256 }}" /tmp/godot_linux.zip | shasum -a 256 -c -
unzip -oq /tmp/godot_linux.zip -d .tools/
chmod +x .tools/Godot_v${{ steps.godot-config.outputs.version }}-${{ steps.godot-config.outputs.status }}_linux.x86_64
- name: Run all test suites
shell: bash
run: |
set -euo pipefail
GODOT=./.tools/Godot_v${{ steps.godot-config.outputs.version }}-${{ steps.godot-config.outputs.status }}_linux.x86_64
FAILED=0
for suite in tests/test_*.gd; do
name=$(basename "$suite" .gd)
if [ "$name" = "test_case" ]; then
continue
fi
log="${name}.log"
if "$GODOT" --headless --path . --script "res://tests/${name}.gd" > "$log" 2>&1 \
&& ! grep -q "SCRIPT ERROR" "$log"; then
PASS_COUNT=$(grep -c ": PASS" "$log" || true)
echo "${name}: ${PASS_COUNT} passed"
else
echo "::error::${name} failed"
cat "$log"
FAILED=1
fi
done
exit $FAILED
macos-validation:
name: macOS validation
runs-on: macos-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: ./.github/actions/load-godot-toolchain
id: godot-config
- name: Download Godot
shell: bash
run: |
set -euo pipefail
mkdir -p .tools/macos
curl -fsSL "${{ steps.godot-config.outputs.macos_url }}" -o /tmp/godot_macos.zip
printf '%s %s\n' "${{ steps.godot-config.outputs.macos_sha256 }}" /tmp/godot_macos.zip | shasum -a 256 -c -
unzip -oq /tmp/godot_macos.zip -d .tools/macos
GODOT_MAC_APP=$(find .tools/macos -maxdepth 2 -name 'Godot.app' -print -quit)
if [ -z "$GODOT_MAC_APP" ]; then
echo "::error::Godot.app not found after unzip"
find .tools/macos -maxdepth 3 -print
exit 1
fi
echo "GODOT_MAC_APP=$GODOT_MAC_APP" >> "$GITHUB_ENV"
chmod +x "$GODOT_MAC_APP/Contents/MacOS/Godot"
- name: Verify Godot binary
shell: bash
run: |
set -euo pipefail
"$GODOT_MAC_APP/Contents/MacOS/Godot" --version
- name: Run headless smoke test
shell: bash
continue-on-error: true
run: |
set -euo pipefail
set +e
python3 - "$GODOT_MAC_APP/Contents/MacOS/Godot" <<'PY'
import subprocess
import sys
godot = sys.argv[1]
with open("smoke.log", "w") as log:
try:
result = subprocess.run(
[godot, "--headless", "--path", ".", "--fixed-fps", 60, "--quit-after", 300],
stdout=log,
stderr=subprocess.STDOUT,
timeout=15,
check=False,
)
except subprocess.TimeoutExpired:
print("Smoke test timed out after 15 seconds", file=sys.stderr)
sys.exit(124)
sys.exit(result.returncode)
PY
SMOKE_EXIT=$?
set -e
if [ -f smoke.log ]; then
cat smoke.log
fi
if [ $SMOKE_EXIT -ne 0 ]; then
echo "Smoke test exited with code $SMOKE_EXIT on macOS runner; keeping script tests as the hard validation gate for this job." >&2
fi
- name: Run all test suites
shell: bash
run: |
set -euo pipefail
FAILED=0
for suite in tests/test_*.gd; do
name=$(basename "$suite" .gd)
if [ "$name" = "test_case" ]; then
continue
fi
log="${name}.log"
if "$GODOT_MAC_APP/Contents/MacOS/Godot" --headless --path . --script "res://tests/${name}.gd" > "$log" 2>&1 \
&& ! grep -q "SCRIPT ERROR" "$log"; then
PASS_COUNT=$(grep -c ": PASS" "$log" || true)
echo "${name}: ${PASS_COUNT} passed"
else
echo "::error::${name} failed"
cat "$log"
FAILED=1
fi
done
exit $FAILED
export-validation:
name: Export validation (Linux)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: ./.github/actions/load-godot-toolchain
id: godot-config
- name: Download Godot
shell: bash
run: |
set -euo pipefail
mkdir -p .tools
curl -fsSL "${{ steps.godot-config.outputs.linux_url }}" -o /tmp/godot_linux.zip
printf '%s %s\n' "${{ steps.godot-config.outputs.linux_sha256 }}" /tmp/godot_linux.zip | shasum -a 256 -c -
unzip -oq /tmp/godot_linux.zip -d .tools/
chmod +x .tools/Godot_v${{ steps.godot-config.outputs.version }}-${{ steps.godot-config.outputs.status }}_linux.x86_64
- name: Install export templates
shell: bash
run: |
set -euo pipefail
mkdir -p ~/.local/share/godot/export_templates/${{ steps.godot-config.outputs.version }}.${{ steps.godot-config.outputs.status }}
curl -fsSL "${{ steps.godot-config.outputs.templates_url }}" -o /tmp/godot_export_templates.tpz
printf '%s %s\n' "${{ steps.godot-config.outputs.templates_sha256 }}" /tmp/godot_export_templates.tpz | shasum -a 256 -c -
unzip -oq /tmp/godot_export_templates.tpz -d /tmp/godot_export_templates
cp -f /tmp/godot_export_templates/templates/* ~/.local/share/godot/export_templates/${{ steps.godot-config.outputs.version }}.${{ steps.godot-config.outputs.status }}/
- name: Export Linux build
shell: bash
run: |
set -euo pipefail
mkdir -p build/export-validation/linux
.tools/Godot_v${{ steps.godot-config.outputs.version }}-${{ steps.godot-config.outputs.status }}_linux.x86_64 --headless --path . --export-release "Linux/X11" ./build/export-validation/linux/windowstead.x86_64
- name: Verify export output
shell: bash
run: |
set -euo pipefail
BINARY="build/export-validation/linux/windowstead.x86_64"
PCK="build/export-validation/linux/windowstead.pck"
if [ ! -s "$BINARY" ]; then
echo "::error::Export binary not found or empty: $BINARY"
exit 1
fi
if [ ! -s "$PCK" ]; then
echo "::error::Export PCK not found or empty: $PCK"
exit 1
fi
echo "Export validation passed — binary and PCK present"
export-validation-windows:
name: Export validation (Windows)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: ./.github/actions/load-godot-toolchain
id: godot-config
- name: Download Godot
shell: bash
run: |
set -euo pipefail
mkdir -p .tools
curl -fsSL "${{ steps.godot-config.outputs.linux_url }}" -o /tmp/godot_linux.zip
printf '%s %s\n' "${{ steps.godot-config.outputs.linux_sha256 }}" /tmp/godot_linux.zip | shasum -a 256 -c -
unzip -oq /tmp/godot_linux.zip -d .tools/
chmod +x .tools/Godot_v${{ steps.godot-config.outputs.version }}-${{ steps.godot-config.outputs.status }}_linux.x86_64
- name: Install export templates
shell: bash
run: |
set -euo pipefail
mkdir -p ~/.local/share/godot/export_templates/${{ steps.godot-config.outputs.version }}.${{ steps.godot-config.outputs.status }}
curl -fsSL "${{ steps.godot-config.outputs.templates_url }}" -o /tmp/godot_export_templates.tpz
printf '%s %s\n' "${{ steps.godot-config.outputs.templates_sha256 }}" /tmp/godot_export_templates.tpz | shasum -a 256 -c -
unzip -oq /tmp/godot_export_templates.tpz -d /tmp/godot_export_templates
cp -f /tmp/godot_export_templates/templates/* ~/.local/share/godot/export_templates/${{ steps.godot-config.outputs.version }}.${{ steps.godot-config.outputs.status }}/
- name: Export Windows build
shell: bash
run: |
set -euo pipefail
mkdir -p build/export-validation/windows
.tools/Godot_v${{ steps.godot-config.outputs.version }}-${{ steps.godot-config.outputs.status }}_linux.x86_64 \
--headless --path . --export-release "Windows Desktop" ./build/export-validation/windows/windowstead.exe
- name: Verify export output
shell: bash
run: |
set -euo pipefail
BINARY="build/export-validation/windows/windowstead.exe"
PCK="build/export-validation/windows/windowstead.pck"
if [ ! -s "$BINARY" ]; then
echo "::error::Export binary not found or empty: $BINARY"
exit 1
fi
if [ ! -s "$PCK" ]; then
echo "::error::Export PCK not found or empty: $PCK"
exit 1
fi
echo "Export validation passed — binary and PCK present"
export-validation-macos:
name: Export validation (macOS)
runs-on: macos-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: ./.github/actions/load-godot-toolchain
id: godot-config
- name: Install Godot and export templates
shell: bash
run: |
set -euo pipefail
GODOT_TEMPLATES_DIR="$HOME/Library/Application Support/Godot/export_templates/${{ steps.godot-config.outputs.version }}.${{ steps.godot-config.outputs.status }}"
mkdir -p "$GODOT_TEMPLATES_DIR"
curl -fsSL "${{ steps.godot-config.outputs.templates_url }}" -o /tmp/godot_export_templates.tpz
printf '%s %s\n' "${{ steps.godot-config.outputs.templates_sha256 }}" /tmp/godot_export_templates.tpz | shasum -a 256 -c -
unzip -oq /tmp/godot_export_templates.tpz -d /tmp/godot_export_templates
cp -f /tmp/godot_export_templates/templates/* "$GODOT_TEMPLATES_DIR/"
mkdir -p .tools/macos
curl -fsSL "${{ steps.godot-config.outputs.macos_url }}" -o /tmp/godot_macos.zip
printf '%s %s\n' "${{ steps.godot-config.outputs.macos_sha256 }}" /tmp/godot_macos.zip | shasum -a 256 -c -
unzip -oq /tmp/godot_macos.zip -d .tools/macos
- name: Export macOS build
shell: bash
run: |
set -euo pipefail
mkdir -p build/export-validation/macos
GODOT_MAC_APP=$(find .tools/macos -maxdepth 2 -name 'Godot.app' -print -quit)
if [ -z "$GODOT_MAC_APP" ]; then
echo 'Godot.app not found in downloaded macOS archive' >&2
exit 1
fi
chmod +x "$GODOT_MAC_APP/Contents/MacOS/Godot"
"$GODOT_MAC_APP/Contents/MacOS/Godot" --headless --path . --export-release "macOS" ./build/export-validation/macos/windowstead.app
- name: Verify export output
shell: bash
run: |
set -euo pipefail
APP="build/export-validation/macos/windowstead.app"
if [ ! -d "$APP" ]; then
echo "::error::Export app bundle not found: $APP"
exit 1
fi
if [ ! -f "$APP/Contents/MacOS/windowstead" ]; then
echo "::error::App bundle missing executable: $APP/Contents/MacOS/windowstead"
exit 1
fi
echo "Export validation passed — app bundle present with executable"
export-validation-web:
name: Export validation (Web)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: ./.github/actions/load-godot-toolchain
id: godot-config
- name: Download Godot
shell: bash
run: |
set -euo pipefail
mkdir -p .tools
curl -fsSL "${{ steps.godot-config.outputs.linux_url }}" -o /tmp/godot_linux.zip
printf '%s %s\n' "${{ steps.godot-config.outputs.linux_sha256 }}" /tmp/godot_linux.zip | shasum -a 256 -c -
unzip -oq /tmp/godot_linux.zip -d .tools/
chmod +x .tools/Godot_v${{ steps.godot-config.outputs.version }}-${{ steps.godot-config.outputs.status }}_linux.x86_64
- name: Install export templates
shell: bash
run: |
set -euo pipefail
mkdir -p ~/.local/share/godot/export_templates/${{ steps.godot-config.outputs.version }}.${{ steps.godot-config.outputs.status }}
curl -fsSL "${{ steps.godot-config.outputs.templates_url }}" -o /tmp/godot_export_templates.tpz
printf '%s %s\n' "${{ steps.godot-config.outputs.templates_sha256 }}" /tmp/godot_export_templates.tpz | shasum -a 256 -c -
unzip -oq /tmp/godot_export_templates.tpz -d /tmp/godot_export_templates
cp -f /tmp/godot_export_templates/templates/* ~/.local/share/godot/export_templates/${{ steps.godot-config.outputs.version }}.${{ steps.godot-config.outputs.status }}/
- name: Export Web build
shell: bash
run: |
set -euo pipefail
mkdir -p build/export-validation/web
.tools/Godot_v${{ steps.godot-config.outputs.version }}-${{ steps.godot-config.outputs.status }}_linux.x86_64 \
--headless --path . --export-release "Web" ./build/export-validation/web/windowstead.html
- name: Verify export output
shell: bash
run: |
set -euo pipefail
DIR="build/export-validation/web"
MISSING=0
for ext in html pck wasm js; do
ARTIFACT="$DIR/windowstead.$ext"
if [ ! -s "$ARTIFACT" ]; then
echo "::error::Expected Web export artifact missing or empty: $ARTIFACT"
MISSING=1
fi
done
if [ "$MISSING" -ne 0 ]; then
echo "::error::Web export validation failed — see missing artifacts above"
exit 1
fi
echo "Export validation passed — .html/.pck/.wasm/.js all present"