From cf805c93e6e1f987a493bca0952eeda7079eae08 Mon Sep 17 00:00:00 2001 From: Joao Paulo Furtado Date: Fri, 6 Nov 2026 14:36:27 -0700 Subject: [PATCH] fix(ci): release-candidate restores the web Wasm engine before its root build Release run 42296982894: resolve ran a root `pnpm build` with no web Wasm engine, examples/spell-lab (default engine) stopped at TN_WASM_ENGINE_MISSING, and ship published nothing for 0.3.12. A ci-structure test now requires native-engine-wasm before every root `pnpm build` in any workflow. --- .github/workflows/release-candidate.yml | 6 +++++- scripts/__tests__/ci-structure.spec.ts | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-candidate.yml b/.github/workflows/release-candidate.yml index 1f7b8cee3a..6af6129f59 100644 --- a/.github/workflows/release-candidate.yml +++ b/.github/workflows/release-candidate.yml @@ -45,7 +45,8 @@ permissions: jobs: resolve: runs-on: ubuntu-24.04 - timeout-minutes: 20 + # A cache miss builds the web Wasm engine with emsdk, so the job needs more than 20 minutes. + timeout-minutes: 45 steps: - uses: actions/checkout@v7 - uses: pnpm/action-setup@v6 @@ -54,6 +55,9 @@ jobs: node-version: 20 cache: pnpm - run: pnpm install --frozen-lockfile + # The root build includes the examples on the default engine, which stop at + # TN_WASM_ENGINE_MISSING without the web Wasm engine (release run 42296982894). + - uses: ./.github/actions/native-engine-wasm - name: Build the workspace packages before comparing published bytes run: pnpm build - name: Write the request and workflow-derived availability diff --git a/scripts/__tests__/ci-structure.spec.ts b/scripts/__tests__/ci-structure.spec.ts index 6c7b6dddb3..babf1f0717 100644 --- a/scripts/__tests__/ci-structure.spec.ts +++ b/scripts/__tests__/ci-structure.spec.ts @@ -5028,3 +5028,21 @@ describe("a CI-configuration-only pull request", () => { } }); }); + +// Release run 42296982894: release-candidate's `resolve` ran a root `pnpm build` with no web Wasm engine, +// and examples/spell-lab (default engine) stopped at TN_WASM_ENGINE_MISSING, so `ship` published nothing. +describe("a job that runs the root build restores the web Wasm engine first", () => { + it("puts native-engine-wasm before every root `pnpm build`", async () => { + const missing: string[] = []; + const dir = path.join(process.cwd(), ".github/workflows"); + for (const relative of (await readdir(dir)).filter((name) => name.endsWith(".yml"))) { + const source = await readFile(path.join(dir, relative), "utf8"); + for (const [job, section] of jobSections(source)) { + const build = section.search(/^\s+(?:-\s+)?run:\s+pnpm build\s*$/mu); + if (build >= 0 && !section.slice(0, build).includes("./.github/actions/native-engine-wasm")) + missing.push(`${relative}:${job}`); + } + } + expect(missing).toEqual([]); + }); +});