Skip to content

Commit 4f64bab

Browse files
ci: smoke the AI asset pipeline template on 4.5 and 5.2
Same blender-smoke.yml pattern as the headless glTF template: generate a fixture, assert exit 0 and glTF magic, then assert missing-input exit 2. Does not add 5.1 to the PR matrix. Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent fea5c80 commit 4f64bab

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

‎.github/workflows/blender-smoke.yml‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,39 @@ jobs:
122122
[ "$code" -eq 2 ] || { echo "::error::expected exit 2 for no-mesh input, got $code"; exit 1; }
123123
echo "no-mesh exit code = $code (correct)"
124124
125+
- name: Build pipeline template fixture GLB
126+
run: |
127+
set -euo pipefail
128+
xvfb-run -a "$BLENDER" --background --python tests/smoke/make_pipeline_glb.py -- \
129+
"$RUNNER_TEMP/out/pipeline_src.glb"
130+
test -s "$RUNNER_TEMP/out/pipeline_src.glb" || { echo "::error::pipeline fixture missing"; exit 1; }
131+
132+
- name: Headless AI asset pipeline template runs (exit 0, LODs produced)
133+
run: |
134+
set -euo pipefail
135+
mkdir -p "$RUNNER_TEMP/out/pipeline"
136+
xvfb-run -a "$BLENDER" --background --python templates/ai-asset-pipeline-template/pipeline.py -- \
137+
--input "$RUNNER_TEMP/out/pipeline_src.glb" \
138+
--outdir "$RUNNER_TEMP/out/pipeline" \
139+
--preset unity \
140+
--lod-budgets 1024,256,64 \
141+
--collider convex
142+
test -s "$RUNNER_TEMP/out/pipeline/lod0.glb" || { echo "::error::lod0 missing/empty"; exit 1; }
143+
test -s "$RUNNER_TEMP/out/pipeline/collider.glb" || { echo "::error::collider missing/empty"; exit 1; }
144+
head -c4 "$RUNNER_TEMP/out/pipeline/lod0.glb" | grep -q "glTF" || { echo "::error::lod0 not a glTF binary"; exit 1; }
145+
146+
- name: Headless pipeline template missing input returns exit 2
147+
run: |
148+
set +e
149+
xvfb-run -a "$BLENDER" --background --python templates/ai-asset-pipeline-template/pipeline.py -- \
150+
--input "$RUNNER_TEMP/out/does-not-exist.glb" \
151+
--outdir "$RUNNER_TEMP/out/pipeline" \
152+
--preset unity
153+
code=$?
154+
set -e
155+
[ "$code" -eq 2 ] || { echo "::error::expected exit 2 for missing input, got $code"; exit 1; }
156+
echo "missing-input exit code = $code (correct)"
157+
125158
- name: Headless render template runs (exit 0, PNG produced)
126159
run: |
127160
set -euo pipefail

‎tests/smoke/make_pipeline_glb.py‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import bmesh
2+
import bpy
3+
import sys
4+
5+
out = sys.argv[sys.argv.index("--") + 1 :][0]
6+
bpy.ops.wm.read_factory_settings(use_empty=True)
7+
me = bpy.data.meshes.new("Fixture")
8+
bm = bmesh.new()
9+
try:
10+
bmesh.ops.create_uvsphere(bm, u_segments=48, v_segments=24, radius=1.0)
11+
bm.to_mesh(me)
12+
finally:
13+
bm.free()
14+
obj = bpy.data.objects.new("Fixture", me)
15+
bpy.context.collection.objects.link(obj)
16+
obj.select_set(True)
17+
bpy.context.view_layer.objects.active = obj
18+
path = out.replace("\\", "/")
19+
bpy.ops.export_scene.gltf(
20+
filepath=path,
21+
export_format="GLB",
22+
use_selection=True,
23+
export_yup=True,
24+
export_apply=True,
25+
export_animations=False,
26+
)
27+
print(f"saved fixture {path}")

0 commit comments

Comments
 (0)