pcbjam/.github/workflows/ci-ubicloud.yml
Gergő Törcsvári 913bc90fa0
ci: single build recipe (reusable) + ordered tag release pipeline; two-tier opt cache
Fixes two coupled bugs: (1) a tag deployed the demo by snapshotting the STALE registry with no build/publish, so v0.1.1 shipped v0.1.0-era wasm; (2) publish-wasm built -O1/3D-off while ci-ubicloud built -O1/3D-on — two diverging recipes.

wasm-build.yml (reusable workflow_call): THE single build+test recipe, parameterized by opt_level / build_3d_viewer / run_tests / no_cache / upload_output. Two-tier output cache around build.sh's new --compile-only/--postprocess-only split: a BASE cache keyed opt-INDEPENDENTLY (compile output + sysroot headers, shared across -O1/-O2) and a FINAL cache keyed opt-SPECIFICALLY. final-hit ⇒ skip all; final-miss+base-hit ⇒ restore base, run only the asyncify/-O tail; full-miss ⇒ compile then postprocess. Both keys now include the 3D flag, closing the cache-poisoning divergence.

ci-ubicloud.yml: thin caller (main/PR/dispatch) → wasm-build at -O1. release.yml (tag v*): meta → build (wasm-build at -O2 + e2e gate, uploads output, reuses main's base cache so only the -O2 tail rebuilds) → publish-wasm (content-addressed push + manifest-<tag>.json) → deploy-demo (build-demo pinned to that manifest + libs/kicad/$LIB_TAG → Pages). So the shipped build is exactly the tested build, and the demo can never point at stale wasm.

deploy-demo.yml: demoted to manual dispatch-only re-deploy (keeps the --from-registry snapshot for re-shipping an already-published tag). publish-wasm.yml: deleted (folded into release.yml + wasm-build.yml).

Validated: actionlint clean (bar the known ubicloud custom-label note), YAML + needs-graph + reusable-path checks pass. NOT runtime-tested — the build can't run locally; needs a CI smoke (a PR exercises ci-ubicloud→wasm-build; a throwaway tag exercises release.yml) before relying on it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 16:23:33 +02:00

49 lines
1.8 KiB
YAML

name: CI full build + e2e (Ubicloud)
# Main/PR gate: build all 6 KiCad WASM tools + run the wxWidgets + KiCad e2e
# suites on a Ubicloud runner. The actual recipe lives in the reusable
# wasm-build.yml (the SINGLE build definition) — this is just the main/PR caller,
# pinned to -O1 for fast feedback. The tag release (release.yml) calls the same
# recipe at -O2 (the shipped demo opt level) and then publishes, so the build can
# never diverge from what ships.
#
# Routine edits under scripts/ do NOT bust the WASM output cache — only the subset
# in scripts/deploy/wasm-cache-hash.mjs does. For inputs the sc-hash can't see
# (base-image / apt drift, a bad cache) bump .ci-cache-epoch; for a one-off
# rebuild put [no-cache] or [rebuild-wasm] in the commit message / PR title.
on:
push:
branches: ["main", "ubicloud-ci"]
paths-ignore: ["docs/**", "**.md"]
pull_request:
branches: ["main"]
paths-ignore: ["docs/**", "**.md"]
workflow_dispatch:
inputs:
binaryen_version:
description: "Binaryen version for the host asyncify step"
required: false
default: "130"
no_cache:
description: "Bypass the KiCad WASM output cache (force a full rebuild this run)"
type: boolean
required: false
default: false
concurrency:
# Per-ref: a new push queues behind its own in-flight run (don't cancel).
group: ci-ubicloud-${{ github.ref }}
cancel-in-progress: false
jobs:
build:
uses: ./.github/workflows/wasm-build.yml
with:
# -O1: faster asyncify shrink, sufficient for the test gate (the demo ships
# -O2 via release.yml). 3D viewer ON so 3d-viewer.spec.ts has a viewer.
opt_level: "-O1"
build_3d_viewer: "ON"
binaryen_version: ${{ inputs.binaryen_version || '130' }}
run_tests: true
no_cache: ${{ inputs.no_cache || false }}