ci(bgfx): re-enable bgfx as a dedicated cached job - #295
Conversation
The build-and-test bgfx step was gated off with `if: false` and a stale comment blaming zbgfx-0.10.1's 0.16-incompatible build.zig. backends/bgfx/build.zig.zon now pins zbgfx 0.12.0, which builds clean on Zig 0.16 (verified locally on macOS: backend tests + Metal example). The real reason to keep bgfx out of the matrix is its C++ compile cost (tens of minutes cold), so split it into a dedicated macos-latest job that caches the Zig global cache + per-project .zig-cache, keyed on the bgfx build.zig.zon so a zbgfx bump busts the cache. Runs the backend `zig build test` and the standalone Metal example build.
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
PR SummaryLow Risk Overview A new Reviewed by Cursor Bugbot for commit 65632c1. Bugbot is set up for automated code reviews on this repo. Configure here. |
Backend work since v0.39.1: - wgpu: macOS Metal surface + textured sprite rendering (#290, #291) - bgfx: macOS bring-up to on-device Android (#296 epic, #304/#305/#307/#308/#309) - #310 AndroidBackendContext adapters: sokol (#312) + bgfx (#313) register the core seam; bgfx-Android gamepad via the shared android_gamepad sub-package - bgfx desktop gamepad: GLFW (#315) + SDL HIDAPI / Switch-pad support (#318) - cached bgfx CI job (#295) Android codegen now calls core.registerAndroidBackend → requires labelle-core >= v1.17.0 + labelle-engine >= v1.50.0.
What
Re-enable the bgfx backend in CI as a dedicated, cached job. bgfx builds clean on Zig 0.16 now (zbgfx is on 0.12.0), and I verified locally on macOS that the backend tests pass and the standalone demo links + initializes the Metal renderer. The only reason it was gated off is the C++ compile cost — so this gives it its own job with
actions/cacheinstead of inlining it into the matrix.Changes (only
.github/workflows/ci.yml)if: falsestep "bgfx backend tests + cross-compile compile-check" inbuild-and-test. Its comment blamed "zbgfx-0.10.1'saddCSourceFiles0.16 migration" — stale (now 0.12.0). The step also ran four-Dtarget=...cross-compile checks; those are dropped (cross-compiling bgfx's C++ to 4 targets would multiply an already-expensive build; the host macOS/Metal target is what's verified).bgfx-build("bgfx backend build + test (macOS)"):runs-on: macos-latest— bgfx is verified there with Metal, and unlike raylib it has nohexops/xcode-frameworkstransitive dep, so the macOS runner fetches + links cleanly.build-and-test(labelle-assembler/+labelle-gui/for theflow-codegenpath-dep),mlugg/setup-zig@v20.16.0.actions/cache@v4over~/.cache/zig+~/Library/Caches/zig+ the bgfx.zig-cachedirs, keyed onhashFiles('.../backends/bgfx/build.zig.zon')with abgfx-${{ runner.os }}-restore-key — so the compiled C++ persists between runs and a zbgfx bump busts the cache.cd backends/bgfx && zig build testthencd backends/bgfx/example && zig build.Verification (macOS arm64, Zig 0.16.0)
yaml.safe_load).backends/bgfx→zig build test: pass.backends/bgfx/example→zig build: pass (produces the Metal demo binary).Note
The first CI run on this job will be slow (cold cache → full bgfx C++ compile, tens of minutes). Subsequent runs restore from the cache and are fast; a zbgfx version bump intentionally triggers one slow rebuild.