From 76289aaf0ae2f99d254952722780925d25294168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20Zim=C3=A1nyi?= Date: Wed, 2 Sep 2026 10:41:58 +0200 Subject: [PATCH] Build the WebAssembly module in CI The job builds the image's `wasm` target and takes `meos.js` and `meos.wasm` out of it, so a pull request that changes the generator, the wrappers or the image answers whether the module it produces still builds, and the listing step shows what came out rather than only an exit code. The `mobilitydb_src` stage is excluded from the cache. The MEOS the module embeds comes from a clone of MobilityDB master made inside the image, and a cached layer freezes it at whatever commit first populated it, so the module would be built against a MEOS nobody is running. The dependency stages build pinned releases and cache safely, which is what makes the job affordable. --- .github/workflows/build.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 71d8dc5..7d28dd5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,3 +70,32 @@ jobs: - name: Type-check run: npx tsc --noEmit + + wasm: + name: Build the WebAssembly module + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: docker/setup-buildx-action@v3 + + # The MEOS the module embeds comes from a clone of MobilityDB master made + # inside the image, so the clone layer must not be served from the cache: + # a cached mobilitydb_src freezes MEOS at whatever commit first populated + # it, and the module would then be built against a MEOS nobody is running. + # The dependency stages (sqlite, geos, proj, json-c, gsl, h3, zlib, + # libxml2, gdal) are pure builds of pinned releases, so they cache safely + # and carry the cost of this job. + - name: Build the WebAssembly module + uses: docker/build-push-action@v6 + with: + context: . + target: wasm + outputs: type=local,dest=./wasm + cache-from: type=gha + cache-to: type=gha,mode=max + no-cache-filters: mobilitydb_src + + - name: Report what the module carries + run: | + ls -la wasm/meos.js wasm/meos.wasm