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.

fix(ci): the arena gate runs where the engine binary is

esengine58d7a7dceb7d
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index af980f1f5..855a8847d 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -244,6 +244,14 @@ jobs:
ESTELLA_REQUIRE_WASM: '1'
run: node tools/check-physics2d.mjs
+ # The multiplayer authority, run where the engine binary actually is. The
+ # fast lane cannot: it builds no wasm, and this gate needs a real engine to
+ # start a real server over a real socket.
+ - name: Check the arena server
+ env:
+ ESTELLA_REQUIRE_WASM: '1'
+ run: node tools/check-arena-server.mjs
+
- name: Check performance snapshot
env:
ESENGINE_WASM_DIR: ${{ github.workspace }}/build/wasm/web
diff --git a/tools/check-arena-server.mjs b/tools/check-arena-server.mjs
index 398cad70f..09b3a99e0 100644
--- a/tools/check-arena-server.mjs
+++ b/tools/check-arena-server.mjs
@@ -24,7 +24,7 @@
* node tools/check-arena-server.mjs
*/
import { spawn, spawnSync } from 'node:child_process';
-import { mkdtempSync, rmSync, writeFileSync } from 'node:fs';
+import { existsSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import path from 'node:path';
import { pathToFileURL, fileURLToPath } from 'node:url';
@@ -38,6 +38,21 @@ const WASM = path.join(ROOT, 'build', 'wasm', 'web');
const BOUND_X = 420;
const STEP = 1 / 60;
+// The server runs a REAL engine, so a checkout without one cannot answer this.
+// Skipped where building it is a choice, an error where CI has the artifact:
+// otherwise "no binary" and "the server is broken" report identically.
+if (!existsSync(path.join(WASM, 'esengine.wasm'))) {
+ const build = 'node build-tools/cli.js build -t web';
+ if (process.env.ESTELLA_REQUIRE_WASM) {
+ console.error('check-arena-server: ESTELLA_REQUIRE_WASM is set and there is no engine wasm'
+ + ` at build/wasm/web.\n ${build}`);
+ process.exit(1);
+ }
+ console.log('check-arena-server: no engine wasm at build/wasm/web — skipped'
+ + ` (build it with \`${build}\`; the engine-coupled CI job sets ESTELLA_REQUIRE_WASM).`);
+ process.exit(0);
+}
+
const work = mkdtempSync(path.join(tmpdir(), 'estella-arena-'));
let server = null;
diff --git a/tools/gates.mjs b/tools/gates.mjs
index 88c701daa..a9a61c0cd 100644
--- a/tools/gates.mjs
+++ b/tools/gates.mjs
@@ -129,7 +129,13 @@ export const GATES = [
// The multiplayer half of that claim: an authority runs as a plain Node
// process over a real socket. Also the only check of two facts the editor's
// preview has no way to reach — no local player, and a connection that LEAVES.
- { id: 'arena-server', run: 'node tools/check-arena-server.mjs' },
+ {
+ id: 'arena-server',
+ run: 'node tools/check-arena-server.mjs',
+ where: 'local',
+ why: 'the server it starts runs the real engine wasm, and the fast CI lane builds none;'
+ + ' the engine-coupled job runs it where the artifact is, under ESTELLA_REQUIRE_WASM',
+ },
{ id: 'cycles', run: 'node tools/check-cycles.mjs' },
{ id: 'layers', run: 'node tools/check-layers.mjs' },
// A system's parameters are what the schedule knows about it; the World