From 81ecf0112b27e0b5c7c5f54910c4c90ecf733083 Mon Sep 17 00:00:00 2001 From: Antonio Leblanc Date: Tue, 27 Oct 2026 10:23:05 -0300 Subject: [PATCH 1/3] ci: build the WASM demo once and deploy it from the same workflow --- .github/workflows/wasm-pages.yml | 96 -------------------------------- .github/workflows/wasm.yml | 45 ++++++++++++++- 2 files changed, 43 insertions(+), 98 deletions(-) delete mode 100644 .github/workflows/wasm-pages.yml diff --git a/.github/workflows/wasm-pages.yml b/.github/workflows/wasm-pages.yml deleted file mode 100644 index 34b6f2e1..00000000 --- a/.github/workflows/wasm-pages.yml +++ /dev/null @@ -1,96 +0,0 @@ -name: ๐ŸŒ Build WASM & Deploy Demo - -# Builds the WebAssembly module (issue #171) and publishes the browser demo to -# GitHub Pages. The .wasm is built here rather than committed: it is a megabyte -# of generated output, and a stale binary next to live sources is worse than a -# two minute build. - -# Publishes from dev. The github-pages environment has to allow dev as a -# deployment branch (Settings โ†’ Environments โ†’ github-pages). -on: - push: - branches: [ "dev" ] - workflow_dispatch: - -permissions: - contents: read - pages: write - id-token: write - -# One deployment at a time; queued runs supersede rather than race. -concurrency: - group: pages - cancel-in-progress: false - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v6 - # No LFS: the WASM build reads no test data, and emcmake turns the - # integrity check off by default. - - - name: Cache Emscripten SDK - id: emsdk-cache - uses: actions/cache@v4 - with: - path: ~/emsdk - key: emsdk-${{ runner.os }}-6.0.6 - - - name: Install Emscripten - if: steps.emsdk-cache.outputs.cache-hit != 'true' - run: | - # Pinned to the version the demo was developed and tested against. - git clone --depth 1 https://github.com/emscripten-core/emsdk.git ~/emsdk - ~/emsdk/emsdk install 6.0.6 - ~/emsdk/emsdk activate 6.0.6 - - - name: Build the WebAssembly module - run: | - source ~/emsdk/emsdk_env.sh - emcmake cmake -S . -B build-wasm -DCMAKE_BUILD_TYPE=Release - cmake --build build-wasm -j"$(nproc)" - - - name: Report size - run: | - { - echo "### WebAssembly build" - echo "| file | raw | gzip | brotli |" - echo "| --- | --- | --- | --- |" - for f in bin/forefire.wasm bin/forefire.mjs; do - printf '| `%s` | %s | %s | %s |\n' "$(basename "$f")" \ - "$(stat -c%s "$f" | numfmt --to=iec)" \ - "$(gzip -c "$f" | wc -c | numfmt --to=iec)" \ - "$(brotli -c "$f" | wc -c | numfmt --to=iec)" - done - } | tee -a "$GITHUB_STEP_SUMMARY" - - - name: Smoke test under Node - run: node bindings/wasm/smoke.mjs bin/forefire.mjs - - - name: Assemble the site - run: | - mkdir -p _site - cp bin/forefire.mjs bin/forefire.wasm _site/ - cp bindings/wasm/index.html bindings/wasm/worker.mjs \ - bindings/wasm/landscape.mjs bindings/wasm/terrain3d.mjs _site/ - # Pages serves through Jekyll unless told otherwise, which would - # swallow files it does not recognise. - touch _site/.nojekyll - - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: _site - - deploy: - needs: build - runs-on: ubuntu-latest - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index 05f7428f..85751ea0 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -1,9 +1,13 @@ name: ๐ŸŒ Build WASM -# Builds the WebAssembly module (issue #171) and runs the Node smoke test. The -# .wasm is built here rather than committed: it is a megabyte of generated +# Builds the WebAssembly module (issue #171) and runs the Node smoke test. On +# dev it also publishes the browser demo to GitHub Pages, from the same build. +# The .wasm is built here rather than committed: it is a megabyte of generated # output, and a stale binary next to live sources is worse than a two minute # build. +# +# The github-pages environment has to allow dev as a deployment branch +# (Settings โ†’ Environments โ†’ github-pages). on: push: @@ -63,3 +67,40 @@ jobs: - name: Smoke test under Node run: node bindings/wasm/smoke.mjs bin/forefire.mjs + + # The demo is published from dev only. + - name: Assemble the site + if: github.ref == 'refs/heads/dev' && github.event_name != 'pull_request' + run: | + mkdir -p _site + cp bin/forefire.mjs bin/forefire.wasm _site/ + cp bindings/wasm/index.html bindings/wasm/worker.mjs \ + bindings/wasm/landscape.mjs bindings/wasm/terrain3d.mjs _site/ + # Pages serves through Jekyll unless told otherwise, which would + # swallow files it does not recognise. + touch _site/.nojekyll + + - name: Upload artifact + if: github.ref == 'refs/heads/dev' && github.event_name != 'pull_request' + uses: actions/upload-pages-artifact@v3 + with: + path: _site + + deploy: + needs: build-wasm + if: github.ref == 'refs/heads/dev' && github.event_name != 'pull_request' + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + # One deployment at a time; queued runs supersede rather than race. + concurrency: + group: pages + cancel-in-progress: false + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 From 30676398bf57e8bf73c7395e40043ea416db773d Mon Sep 17 00:00:00 2001 From: Antonio Leblanc Date: Tue, 27 Oct 2026 10:23:32 -0300 Subject: [PATCH 2/3] ci: skip the builds on docs-only changes --- .github/workflows/docker.yml | 2 ++ .github/workflows/invariants.yml | 2 ++ .github/workflows/macos.yml | 2 ++ .github/workflows/main.yml | 2 ++ .github/workflows/sanitizers.yml | 2 ++ .github/workflows/wasm.yml | 2 ++ .github/workflows/wheels.yml | 2 ++ 7 files changed, 14 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 22f22bfa..1cbcdb73 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,9 +2,11 @@ name: ๐Ÿ“ฆ Build & Test Docker Image on: push: + paths-ignore: [ "docs/**", "**/*.md" ] branches: [ "master" ] tags: [ 'v*.*.*' ] pull_request: + paths-ignore: [ "docs/**", "**/*.md" ] branches: [ "master" ] workflow_dispatch: diff --git a/.github/workflows/invariants.yml b/.github/workflows/invariants.yml index a62dcb53..5c011548 100644 --- a/.github/workflows/invariants.yml +++ b/.github/workflows/invariants.yml @@ -11,10 +11,12 @@ name: ๐Ÿ”ฌ Model Invariants (Linux) on: push: + paths-ignore: [ "docs/**", "**/*.md" ] branches: - "master" - "dev" pull_request: + paths-ignore: [ "docs/**", "**/*.md" ] branches: [ "master", "dev" ] workflow_dispatch: diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index a940bfb9..28779f51 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -2,9 +2,11 @@ name: ๐Ÿงช Test Native (macOS) on: push: + paths-ignore: [ "docs/**", "**/*.md" ] branches: - brew pull_request: + paths-ignore: [ "docs/**", "**/*.md" ] branches: [ "master", "dev" ] workflow_dispatch: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ff104d63..59cbe002 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,10 +2,12 @@ name: ๐Ÿงช Test Native (Linux) on: push: + paths-ignore: [ "docs/**", "**/*.md" ] branches: - "master" - "dev" pull_request: + paths-ignore: [ "docs/**", "**/*.md" ] branches: [ "master", "dev" ] workflow_dispatch: diff --git a/.github/workflows/sanitizers.yml b/.github/workflows/sanitizers.yml index f0a204de..14123b2b 100644 --- a/.github/workflows/sanitizers.yml +++ b/.github/workflows/sanitizers.yml @@ -22,10 +22,12 @@ name: ๐Ÿงผ Sanitizers (Linux) on: push: + paths-ignore: [ "docs/**", "**/*.md" ] branches: - "master" - "dev" pull_request: + paths-ignore: [ "docs/**", "**/*.md" ] branches: [ "master", "dev" ] workflow_dispatch: diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index 85751ea0..73a08244 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -11,10 +11,12 @@ name: ๐ŸŒ Build WASM on: push: + paths-ignore: [ "docs/**", "**/*.md" ] branches: - "master" - "dev" pull_request: + paths-ignore: [ "docs/**", "**/*.md" ] branches: [ "master", "dev" ] workflow_dispatch: diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 35fb3218..7ae74cf3 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -2,11 +2,13 @@ name: ๐Ÿ Build Python wheels on: push: + paths-ignore: [ "docs/**", "**/*.md" ] branches: - "master" tags: - "v*" pull_request: + paths-ignore: [ "docs/**", "**/*.md" ] branches: [ "master" ] release: types: [ published ] From 2ee38cd3a2f8747e7576d4f2930a59597dd363b4 Mon Sep 17 00:00:00 2001 From: Antonio Leblanc Date: Tue, 27 Oct 2026 10:23:44 -0300 Subject: [PATCH 3/3] ci: cancel superseded PR runs --- .github/workflows/docker.yml | 6 ++++++ .github/workflows/invariants.yml | 6 ++++++ .github/workflows/macos.yml | 6 ++++++ .github/workflows/main.yml | 6 ++++++ .github/workflows/sanitizers.yml | 6 ++++++ .github/workflows/wasm.yml | 6 ++++++ .github/workflows/wheels.yml | 6 ++++-- 7 files changed, 40 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1cbcdb73..899bbe0b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -10,6 +10,12 @@ on: branches: [ "master" ] workflow_dispatch: +# A new push to a PR cancels its older run. Pushes to branches, tags and +# releases each get their own group, so none is ever queued or dropped. +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} diff --git a/.github/workflows/invariants.yml b/.github/workflows/invariants.yml index 5c011548..da8c1f9f 100644 --- a/.github/workflows/invariants.yml +++ b/.github/workflows/invariants.yml @@ -20,6 +20,12 @@ on: branches: [ "master", "dev" ] workflow_dispatch: +# A new push to a PR cancels its older run. Pushes to branches, tags and +# releases each get their own group, so none is ever queued or dropped. +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + jobs: invariants: name: Dead fuel moisture invariants diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 28779f51..2d6fb4e5 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -10,6 +10,12 @@ on: branches: [ "master", "dev" ] workflow_dispatch: +# A new push to a PR cancels its older run. Pushes to branches, tags and +# releases each get their own group, so none is ever queued or dropped. +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + jobs: build-native-macos: runs-on: macos-latest diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 59cbe002..efcca169 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,6 +11,12 @@ on: branches: [ "master", "dev" ] workflow_dispatch: +# A new push to a PR cancels its older run. Pushes to branches, tags and +# releases each get their own group, so none is ever queued or dropped. +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + jobs: build-native: runs-on: ubuntu-latest diff --git a/.github/workflows/sanitizers.yml b/.github/workflows/sanitizers.yml index 14123b2b..e5022ad2 100644 --- a/.github/workflows/sanitizers.yml +++ b/.github/workflows/sanitizers.yml @@ -31,6 +31,12 @@ on: branches: [ "master", "dev" ] workflow_dispatch: +# A new push to a PR cancels its older run. Pushes to branches, tags and +# releases each get their own group, so none is ever queued or dropped. +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + jobs: address-sanitizer: name: AddressSanitizer diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index 73a08244..0b92a82c 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -20,6 +20,12 @@ on: branches: [ "master", "dev" ] workflow_dispatch: +# A new push to a PR cancels its older run. Pushes to branches, tags and +# releases each get their own group, so none is ever queued or dropped. +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + permissions: contents: read diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 7ae74cf3..be10018e 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -14,9 +14,11 @@ on: types: [ published ] workflow_dispatch: +# A new push to a PR cancels its older run. Pushes to branches, tags and +# releases each get their own group, so none is ever queued or dropped. concurrency: - group: wheels-${{ github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true jobs: build-wheels: