Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

ci: engine jobs take the engine host, editor jobs take the editor's

esengine7a5dbe965bbc
diff --git a/.github/actions/editor-host/action.yml b/.github/actions/editor-host/action.yml
new file mode 100644
index 000000000..11551c9d0
--- /dev/null
+++ b/.github/actions/editor-host/action.yml
@@ -0,0 +1,29 @@
+name: Editor host from this run's engine
+description: Stage the wasm this run built into the editor host, with the SDK and the renderer bundle built against it.
+
+# For the gates whose subject IS the editor. The engine's own host is a sibling
+# action; a job that measures the renderer should take that one, so an editor
+# checkout is never on the path of an engine verdict.
+runs:
+ using: composite
+ steps:
+ - name: Download web wasm artifact
+ uses: actions/download-artifact@v8
+ with:
+ name: wasm-web
+ path: build/wasm/web/
+
+ - name: Build SDK
+ shell: bash
+ run: pnpm --filter ./sdk build
+
+ - name: Stage wasm for the editor host
+ shell: bash
+ run: |
+ mkdir -p desktop/public/wasm
+ cp build/wasm/web/* desktop/public/wasm/
+
+ - name: Build editor renderer bundle
+ shell: bash
+ working-directory: desktop
+ run: pnpm exec vite build
diff --git a/.github/actions/render-host/action.yml b/.github/actions/render-host/action.yml
index f195a0283..a45bcb85e 100644
--- a/.github/actions/render-host/action.yml
+++ b/.github/actions/render-host/action.yml
@@ -1,9 +1,9 @@
-name: Editor host from this run's engine
-description: Stage the wasm this run built into the editor host, with the SDK and the renderer bundle built against it.
+name: Engine render host from this run's engine
+description: Build the engine's headless render host against the wasm this run produced.
-# Every job that measures pixels needs the same four steps between the artifact
-# and a runnable host. Two jobs do, and a second copy of them is a copy that
-# drifts — one of them would end up measuring an engine the other never built.
+# Every job that measures pixels needs the same three steps between the artifact
+# and a runnable host. More than one does, and a second copy of them is a copy
+# that drifts — one job would end up measuring an engine the other never built.
runs:
using: composite
steps:
@@ -17,13 +17,6 @@ runs:
shell: bash
run: pnpm --filter ./sdk build
- - name: Stage wasm for the editor host
+ - name: Build the render host
shell: bash
- run: |
- mkdir -p desktop/public/wasm
- cp build/wasm/web/* desktop/public/wasm/
-
- - name: Build editor renderer bundle
- shell: bash
- working-directory: desktop
- run: pnpm exec vite build
+ run: node tools/render-host/build.mjs
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 2631cb57c..a7b8cf97c 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -288,7 +288,7 @@ jobs:
# is WebGPU-dead by design and gen-shader-twins --check exits 1 on it. Covers
# examples/ too so a shipped user shader can never regress to WebGL-only.
- name: Check shader twins
- run: node tools/gen-shader-twins.mjs --check $(find desktop/public/scenes examples -name '*.esshader')
+ run: node tools/gen-shader-twins.mjs --check $(find fixtures/scenes examples -name '*.esshader')
# Pipeline smoke: strip a fixture's twins into a temp copy and require the
# vendored converters (glslang wasm + naga WASI wasm) to produce one —
@@ -296,7 +296,7 @@ jobs:
- name: Shader-twin pipeline smoke
run: |
tmp=$(mktemp -d)
- sed '/#pragma vertex wgsl/,$d' desktop/public/scenes/mat-tint/tint.esshader > "$tmp/smoke.esshader"
+ sed '/#pragma vertex wgsl/,$d' fixtures/scenes/mat-tint/tint.esshader > "$tmp/smoke.esshader"
if node tools/gen-shader-twins.mjs --check "$tmp/smoke.esshader"; then
echo "expected would-generate (exit 1) for a twin-less shader"; exit 1
fi
@@ -305,16 +305,9 @@ jobs:
# The list lives in tools/renderScenes.mjs, not here: CI and a developer
# ran two lists that had drifted both ways — thirty-two declared gates
# nothing ran, five CI scenes with no name to reproduce them by.
- # --no-build: the renderer bundle is already built two steps up.
- run: node tools/verify-render.mjs --tier pr --no-build
-
- - name: Run MCP end-to-end
- working-directory: desktop
- env:
- ELECTRON_DISABLE_SANDBOX: '1'
- run: |
- xvfb-run -a node scripts/editor-mcp-e2e.mjs
- xvfb-run -a node scripts/editor-mcp-editor-e2e.mjs
+ # --no-build: the host is already built two steps up. --host engine takes
+ # the scenes that need no editor; verify-editor runs the rest.
+ run: node tools/verify-render.mjs --tier pr --host engine --no-build
# The EDITOR's authoring surface, driven for real. The engine has had a pixel
# gate for years; the editor had none, which is how depth layers shipped
@@ -336,10 +329,12 @@ jobs:
steps:
- uses: actions/checkout@v7
+ with:
+ submodules: true
- uses: ./.github/actions/setup
- - uses: ./.github/actions/render-host
+ - uses: ./.github/actions/editor-host
- name: Run editor authoring checks
working-directory: desktop
@@ -347,6 +342,22 @@ jobs:
ELECTRON_DISABLE_SANDBOX: '1'
run: xvfb-run -a node scripts/editor-checks/run.mjs
+ # The pixel gates whose subject is an editor door — the reference grid, hit
+ # testing, the editor eye, preview renders. They cannot run on the engine's
+ # host, which deliberately has none of those.
+ - name: Run the editor's pixel gates
+ env:
+ ELECTRON_DISABLE_SANDBOX: '1'
+ run: xvfb-run -a node tools/verify-render.mjs --tier pr --host editor --no-build
+
+ - name: Run MCP end-to-end
+ working-directory: desktop
+ env:
+ ELECTRON_DISABLE_SANDBOX: '1'
+ run: |
+ xvfb-run -a node scripts/editor-mcp-e2e.mjs
+ xvfb-run -a node scripts/editor-mcp-editor-e2e.mjs
+
verify-packages:
name: Packages (golden + released)
runs-on: ubuntu-latest
@@ -360,10 +371,12 @@ jobs:
# …), which a shallow checkout has none of — the step failed on every run
# that ever reached it.
fetch-depth: 0
+ # The comparison frame is the EDITOR's, so this job needs its checkout.
+ submodules: true
- uses: ./.github/actions/setup
- - uses: ./.github/actions/render-host
+ - uses: ./.github/actions/editor-host
# The golden corpus, packaged and opened the way a player opens it, then held
# against the editor's own frame of the same game. Exporting was checked and
@@ -415,7 +428,7 @@ jobs:
- name: Second backend, PR tier
env:
ESTELLA_VERIFY_WEBGPU_ADAPTER: ''
- run: node tools/verify-render.mjs --tier pr --backend webgpu --no-build --budget 45
+ run: node tools/verify-render.mjs --tier pr --backend webgpu --host engine --no-build --budget 45
# The native runtime, judged by pixels on a machine with no GPU.
#
diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml
index dafd714de..20fc0630b 100644
--- a/.github/workflows/release-desktop.yml
+++ b/.github/workflows/release-desktop.yml
@@ -345,7 +345,17 @@ jobs:
contents: write
steps:
+ # The editor is a private submodule, so this needs a token that can read it.
+ # EDITOR_SUBMODULE_TOKEN is the one; without it the job fails at checkout
+ # rather than publishing an installer built from whatever was left behind.
- uses: actions/checkout@v7
+ with:
+ submodules: false
+ token: ${{ secrets.EDITOR_SUBMODULE_TOKEN || secrets.GITHUB_TOKEN }}
+
+ - name: Check out the editor
+ shell: bash
+ run: git submodule update --init --depth 1 desktop
- uses: ./.github/actions/setup
diff --git a/tools/verify-desktop-render.mjs b/tools/verify-desktop-render.mjs
index 34ea371c7..39a4331af 100644
--- a/tools/verify-desktop-render.mjs
+++ b/tools/verify-desktop-render.mjs
@@ -124,7 +124,7 @@ function desktopPixelsFor(id) {
const opts = parseArgs(process.argv.slice(2));
const templateDir = opts.template ?? installedTemplateDir(
- JSON.parse(readFileSync(path.join(ROOT, 'desktop', 'package.json'), 'utf8')).version, HOST_OS);
+ JSON.parse(readFileSync(path.join(ROOT, 'package.json'), 'utf8')).version, HOST_OS);
if (!templateDir || !existsSync(templateDir)) {
console.error(`verify-desktop-render: no ${HOST_OS} runtime template installed — build one with `
+ `\`node build-tools/cli.js native --target ${HOST_OS}\`.`);