From 20e1f02ff56dec511b585254dcd32e3ecfe2f9ea Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Sat, 15 Aug 2026 16:52:06 +0200 Subject: [PATCH] Build the bindings on every push and pull request The repository runs only a docs deployment, so nothing regenerates the bindings, compares them against the committed sources, or type-checks the result. Eleven hand-written wrappers reached main without consulting the MEOS error state partly for that reason: the generator asserts the invariant, but the assertion only fires when somebody regenerates by hand. The job regenerates from the committed catalog, fails on any drift against core/functions/functions.generated.ts and core/c-src/bindings.c, and type-checks. Drift means either the generator changed without its output being refreshed or the output was edited directly, and both leave a surface no catalog projection produces. Running the runtime tests needs the WebAssembly module, which the Docker emscripten target builds and the repository does not commit, so that job is separate work. --- .github/workflows/build.yml | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..8181a8e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,38 @@ +name: Build + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +jobs: + generate-and-typecheck: + name: Regenerate from the catalog and type-check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - run: npm ci + + # Regenerating must reproduce the committed sources exactly. A drift means + # either the generator changed without its output being refreshed, or the + # output was edited by hand -- both make the committed surface something no + # catalog projection produces. + # + # This step also runs the generator's own assertion that every emitted + # wrapper consults the MEOS error state, which otherwise only fires when + # somebody regenerates locally. + - name: Regenerate the bindings + run: npm run generate + + - name: Fail on drift between the generator and the committed sources + run: git diff --exit-code -- core/functions/functions.generated.ts core/c-src/bindings.c + + - name: Type-check + run: npx tsc --noEmit