Skip to content

Commit 32c56a8

Browse files
committed
ci: build the GUI in every job that runs the root suite
The first sharded run went red on shard 1/4 and macos, and the failure was mine rather than flaky: tests that fetch the served dashboard read their session bootstrap out of gui/dist/index.html, and nothing in those jobs built it. The old three-platform job satisfied this by accident. It ran the suite and the GUI build in the same job, so gui/dist always existed by the time the tests ran. Splitting the suite away from the gates removed the coincidence without removing the dependency, and area-scoping the gates' build behind `gui/**` meant even that copy was conditional. Reproduced on an untouched checkout of dev to be sure the split was the cause: the same test fails there with no gui/dist present and passes after `bun run build`. So the dependency is real and pre-existing; only its accidental satisfaction disappeared. The suite pin that would have caught this now exists: every job running the root suite must have an unconditional GUI build step. It was driven red before being kept.
1 parent 54a9c9b commit 32c56a8

2 files changed

Lines changed: 37 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,17 @@ jobs:
218218
cd gui
219219
bun install --frozen-lockfile
220220
221+
# Nor is the build. Tests that fetch the served dashboard read the session
222+
# bootstrap meta tags out of `gui/dist/index.html`, so without a build the
223+
# server has no index to serve and those assertions see an empty string.
224+
# The old three-platform job happened to satisfy this because every leg ran
225+
# the GUI build as part of the same job; splitting the suite away from the
226+
# gates removed that coincidence, so the dependency has to be explicit.
227+
- name: Build GUI
228+
run: |
229+
cd gui
230+
bun run build
231+
221232
- name: Test
222233
run: bun test --isolate tests --shard=${{ matrix.shard }}/4
223234

@@ -301,6 +312,12 @@ jobs:
301312
cd gui
302313
bun install --frozen-lockfile
303314
315+
# Same reason as the shards: the suite serves gui/dist and reads it back.
316+
- name: Build GUI
317+
run: |
318+
cd gui
319+
bun run build
320+
304321
- name: Test
305322
run: bun test --isolate tests
306323

@@ -366,6 +383,12 @@ jobs:
366383
cd gui
367384
bun install --frozen-lockfile
368385
386+
# Same reason as the shards: the suite serves gui/dist and reads it back.
387+
- name: Build GUI
388+
run: |
389+
cd gui
390+
bun run build
391+
369392
- name: Test
370393
run: bun test --isolate tests
371394

‎tests/ci-workflows.test.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,20 @@ describe("GitHub Actions hardening", () => {
105105
expect(winSteps.some(step => step.run?.includes("--shard"))).toBe(false);
106106
expect(winSteps.some(step => step.if === "runner.environment == 'self-hosted'"
107107
&& step.run?.includes("git clean -xffd"))).toBe(true);
108+
109+
// Every job that runs the root suite must build the GUI first, unconditionally.
110+
// Tests that fetch the served dashboard read their session bootstrap out of
111+
// `gui/dist/index.html`; with no build the server has no index to serve and the
112+
// assertions read an empty string. The old three-platform job satisfied this by
113+
// accident, because the same job also ran the GUI build — splitting the suite
114+
// away from the gates removed that coincidence, and the shards went red on a
115+
// pull request before this pin existed.
116+
for (const jobName of ["test", "platform-macos", "platform-windows"]) {
117+
const steps = (ci.jobs?.[jobName] as { steps?: { if?: string; run?: string }[] })?.steps ?? [];
118+
const build = steps.find(step => step.run?.includes("bun run build"));
119+
expect(`${jobName}:${build === undefined}`).toBe(`${jobName}:false`);
120+
expect(`${jobName}:${build?.if ?? "unconditional"}`).toBe(`${jobName}:unconditional`);
121+
}
108122
});
109123

110124
test("PR checks reach every branch the target gate accepts", async () => {

0 commit comments

Comments
 (0)