-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathorchestrator-engine-smoke-test.yml
More file actions
297 lines (268 loc) · 11.7 KB
/
Copy pathorchestrator-engine-smoke-test.yml
File metadata and controls
297 lines (268 loc) · 11.7 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
name: Orchestrator Engine Smoke Tests
# Port of plugins/orchestrator/.github/workflows/engine-smoke-test.yml,
# inert as a nested workflow. Distinct from root's own "Engine Smoke
# Tests" (engine-smoke-test.yml) - that one validates the CLI's built-in
# unity/godot/unreal plugins directly; this one validates the same
# engines dispatched THROUGH the orchestrator provider system. No secrets
# required - Docker-in-Docker against public third-party images only.
on:
push:
branches: [main, 'release/**', 'feat/**']
paths:
- 'plugins/orchestrator/**'
- '.github/workflows/orchestrator-engine-smoke-test.yml'
pull_request:
branches: [main, 'release/**']
paths:
- 'plugins/orchestrator/**'
- '.github/workflows/orchestrator-engine-smoke-test.yml'
workflow_dispatch:
inputs:
godot-version:
description: 'Godot version tag for barichello/godot-ci image'
required: false
default: '4.3'
unreal-image:
description: 'Real UE Docker image for full build test (leave empty to use CI stub)'
required: false
default: ''
defaults:
run:
working-directory: plugins/orchestrator
jobs:
# ─── Godot — actual project export using third-party image ─────
godot-build:
name: Godot build (barichello/godot-ci)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Export Godot project
run: |
GODOT_VERSION="${{ github.event.inputs.godot-version || '4.3' }}"
echo "Building with barichello/godot-ci:${GODOT_VERSION}"
mkdir -p test-projects/godot-minimal/build
docker run --rm \
-v "${{ github.workspace }}/plugins/orchestrator/test-projects/godot-minimal:/project" \
-w /project \
"barichello/godot-ci:${GODOT_VERSION}" \
bash -c '
echo "=== Godot $(godot --headless --version) ==="
mkdir -p build
# Try export first, fall back to import validation
godot --headless --verbose --export-release "Linux/X11" build/game.x86_64 2>&1 || \
godot --headless --verbose --export-release "Linux" build/game.x86_64 2>&1 || {
echo "Export preset not matched — validating project import instead"
godot --headless --import 2>&1
}
echo "=== Build artifacts ==="
ls -la build/ 2>/dev/null || echo "(import-only mode)"
echo "=== DONE ==="
'
- name: Verify build output
run: |
if [ -f test-projects/godot-minimal/build/game.x86_64 ]; then
echo "Godot export produced binary — full build success"
ls -la test-projects/godot-minimal/build/
else
echo "Godot import validation passed (no export binary in minimal project)"
fi
# ─── Godot — orchestrator integration ──────────────────────────
godot-orchestrator:
name: Godot orchestrator integration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install package manager (from package.json)
run: |
corepack enable
corepack install
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Resolve yarn cache folder
id: yarn-config
run: echo "cacheFolder=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
- name: Restore yarn install cache (node_modules + cacheFolder + install-state)
uses: actions/cache@v4
with:
path: |
plugins/orchestrator/node_modules
${{ steps.yarn-config.outputs.cacheFolder }}
plugins/orchestrator/.yarn/install-state.gz
key: yarn-${{ runner.os }}-node-'20'-${{ hashFiles('plugins/orchestrator/yarn.lock') }}
restore-keys: |
yarn-${{ runner.os }}-node-'20'-
- run: yarn install --immutable
- run: yarn build
- name: Verify built-in Godot engine plugin
run: |
node -e "
const { initEngine, getEngine } = require('./dist/model/engine');
initEngine('godot');
const e = getEngine();
if (e.name !== 'godot') throw new Error('wrong engine');
if (!e.cacheFolders.includes('.godot/imported')) throw new Error('missing cache');
console.log('Godot plugin:', e.name, 'cache:', e.cacheFolders);
"
- name: Dispatch Godot version check via orchestrator
run: |
GODOT_VERSION="${{ github.event.inputs.godot-version || '4.3' }}"
RESPONSE=$(echo '{"command":"run-task","params":{"buildGuid":"godot-smoke","image":"barichello/godot-ci:'"${GODOT_VERSION}"'","commands":"godot --headless --version","mountdir":"/build","workingdir":"/build","environment":[],"secrets":[]}}' | \
node dist/cli.js serve \
--provider-strategy local-docker \
--engine godot \
--project-path test-projects/godot-minimal \
2>godot-stderr.log | tail -1) || true
echo "Response: ${RESPONSE}"
cat godot-stderr.log 2>/dev/null || true
# ─── UE — build with CI stub (validates full pipeline) ─────────
unreal-stub-build:
name: UE build (CI stub)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build UE CI stub image
run: |
docker build \
-t game-ci/ue-stub:latest \
-f test-projects/unreal-minimal/Dockerfile.ci-stub \
test-projects/unreal-minimal/
- name: Build Unreal project with stub
run: |
docker run --rm \
-v "${{ github.workspace }}/plugins/orchestrator/test-projects/unreal-minimal:/build" \
-w /build \
game-ci/ue-stub:latest \
/home/ue4/UnrealEngine/Engine/Build/BatchFiles/RunUAT.sh \
BuildCookRun \
-project=/build/MinimalTest.uproject \
-targetplatform=Linux \
-clientconfig=Shipping \
-build -cook -stage -pak -archive \
-archivedirectory=/build/output \
-noP4 -unattended
- name: Verify UE build artifacts
run: |
echo "=== Build output ==="
cat test-projects/unreal-minimal/output/build-manifest.json
node -e "
const m = require('./test-projects/unreal-minimal/output/build-manifest.json');
if (m.engine !== 'unreal') throw new Error('wrong engine');
if (m.engineVersion !== '5.4') throw new Error('wrong version');
console.log('UE stub build verified:', JSON.stringify(m));
"
# ─── UE — orchestrator integration ─────────────────────────────
unreal-orchestrator:
name: UE orchestrator integration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install package manager (from package.json)
run: |
corepack enable
corepack install
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Resolve yarn cache folder
id: yarn-config
run: echo "cacheFolder=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
- name: Restore yarn install cache (node_modules + cacheFolder + install-state)
uses: actions/cache@v4
with:
path: |
plugins/orchestrator/node_modules
${{ steps.yarn-config.outputs.cacheFolder }}
plugins/orchestrator/.yarn/install-state.gz
key: yarn-${{ runner.os }}-node-'20'-${{ hashFiles('plugins/orchestrator/yarn.lock') }}
restore-keys: |
yarn-${{ runner.os }}-node-'20'-
- run: yarn install --immutable
- run: yarn build
- name: Verify built-in Unreal engine plugin
run: |
node -e "
const { initEngine, getEngine } = require('./dist/model/engine');
initEngine('unreal');
const e = getEngine();
if (e.name !== 'unreal') throw new Error('wrong engine');
console.log('UE plugin:', e.name, 'cache:', e.cacheFolders);
"
- name: Test serve protocol with Unreal engine
run: |
RESPONSE=$(echo '{"command":"list-resources","params":{}}' | \
node dist/cli.js serve \
--provider-strategy test \
--engine unreal \
--project-path test-projects/unreal-minimal \
2>/dev/null | tail -1) || true
echo "Response: ${RESPONSE}"
echo "${RESPONSE}" | node -e "
const d = JSON.parse(require('fs').readFileSync('/dev/stdin','utf-8'));
if (!('success' in d)) throw new Error('bad protocol response');
"
# ─── UE — real image build (manual trigger) ────────────────────
unreal-real-build:
name: UE build (real image)
runs-on: ubuntu-latest
if: github.event.inputs.unreal-image != ''
steps:
- uses: actions/checkout@v4
- name: Pull and build with real UE image
run: |
UE_IMAGE="${{ github.event.inputs.unreal-image }}"
echo "Pulling: ${UE_IMAGE}"
docker pull "${UE_IMAGE}"
docker run --rm \
-v "${{ github.workspace }}/plugins/orchestrator/test-projects/unreal-minimal:/build" \
-w /build \
"${UE_IMAGE}" \
bash -c "echo 'UE container running' && ls / && echo 'SUCCESS'"
# ─── Protocol Integration Test ─────────────────────────────────
serve-protocol-test:
name: Serve protocol integration test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install package manager (from package.json)
run: |
corepack enable
corepack install
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Resolve yarn cache folder
id: yarn-config
run: echo "cacheFolder=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
- name: Restore yarn install cache (node_modules + cacheFolder + install-state)
uses: actions/cache@v4
with:
path: |
plugins/orchestrator/node_modules
${{ steps.yarn-config.outputs.cacheFolder }}
plugins/orchestrator/.yarn/install-state.gz
key: yarn-${{ runner.os }}-node-'20'-${{ hashFiles('plugins/orchestrator/yarn.lock') }}
restore-keys: |
yarn-${{ runner.os }}-node-'20'-
- run: yarn install --immutable
- run: yarn build
- name: Test all serve subcommands
run: |
COMMANDS=("list-resources" "list-workflow" "watch-workflow" "garbage-collect")
for cmd in "${COMMANDS[@]}"; do
echo "Testing: ${cmd}"
RESPONSE=$(echo "{\"command\":\"${cmd}\",\"params\":{}}" | \
node dist/cli.js serve --provider-strategy test 2>/dev/null | tail -1) || true
echo " ${RESPONSE}"
echo "${RESPONSE}" | node -e "
const d = JSON.parse(require('fs').readFileSync('/dev/stdin','utf-8'));
if (!('success' in d)) process.exit(1);
" || { echo "FAIL: ${cmd}"; exit 1; }
done
- name: Test error handling
run: |
for input in "" "not json" '{"params":{}}'; do
RESPONSE=$(echo "${input}" | node dist/cli.js serve --provider-strategy test 2>/dev/null | tail -1) || true
echo "${RESPONSE}" | grep -q '"success":false' || { echo "FAIL for input: '${input}'"; exit 1; }
done
echo "Error handling OK"