Skip to content

ci: cached bgfx example build job (#286) - #288

Closed
apotema wants to merge 1 commit into
mainfrom
ci/286-bgfx-cached-example
Closed

apotema wants to merge 1 commit into
mainfrom
ci/286-bgfx-cached-example

Conversation

@apotema

@apotema apotema commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Closes #286

What

Adds a dedicated, cached CI job bgfx-example to .github/workflows/ci.yml that generates and builds examples/bgfx, so bgfx template/codegen regressions are caught by a real build. PR #284 fixed bgfx's lifecycle template and example but had to leave the backend un-gated because its C++ compile runs 50+ minutes cold — far too slow for the shared examples-integration job.

Job design

  • pull_request-only (if: github.event_name == 'pull_request'), ubuntu-latest, timeout-minutes: 90 to cover the cold case.
  • Same sibling-checkout recipe as the examples-integration job (labelle-gui, labelle-cli + its zig-pkg/labelle-gui unpack path, labelle-core/engine/gfx at main), same apt deps, same mlugg/setup-zig@v2 / Zig 0.16.0.
  • actions/cache@v4 persists the generated project's LOCAL zig cache, labelle-assembler/examples/bgfx/.labelle/bgfx_desktop/.zig-cache — mlugg/setup-zig already caches the global zig cache, but the expensive bgfx/bimg/bx C++ objects land in the example's local cache.
  • Key: bgfx-example-${{ hashFiles('labelle-assembler/backends/bgfx/**') }} so backend changes roll the key, with a bgfx-example- restore-keys prefix fallback so warm runs still restore the bulk of the compiled C++ objects even when the key changes and only the delta rebuilds.
  • The cache is restored before labelle generate, which rewrites generated sources but leaves .zig-cache intact.
  • Also updates the stale comment on the wgpu example step that said bgfx was un-gated.

Verification

This PR's own CI run is the proof: the new bgfx-example job runs on this PR. Note the first run is a cold ~50 min build (no cache exists yet); subsequent PR runs restore the cache via the prefix fallback and should complete in minutes.

🤖 Generated with Claude Code

Add a dedicated pull_request-only `bgfx-example` job that generates and
builds examples/bgfx, gating the bgfx lifecycle template / codegen path
fixed in #284 behind a real build.

The bgfx C++ compile runs ~50 min cold, so the job persists the
generated project's local .zig-cache via actions/cache@v4, keyed on
hashFiles('labelle-assembler/backends/bgfx/**') with a `bgfx-example-`
restore-keys prefix fallback so warm runs restore the compiled C++
objects even when the key rolls. timeout-minutes: 90 covers the cold
case.

Closes #286

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@cursor

cursor Bot commented Jun 12, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
CI workflow-only change; no runtime or product code paths affected.

Overview
Adds a pull_request-only bgfx-example job that runs labelle generate and zig build on examples/bgfx, so bgfx codegen/template regressions are caught in CI without bloating the shared examples-integration job.

The job mirrors the sibling-repo checkout and build setup used elsewhere, then uses actions/cache@v4 on the generated project’s local .labelle/bgfx_desktop/.zig-cache (keyed on backends/bgfx/** with a prefix fallback) so cold ~50 minute C++ compiles amortize to warm runs in minutes. Cache restore happens before generate so regenerated Zig sources still reuse cached C++ objects. 90-minute timeout covers the first cold run.

The wgpu example step comment is updated to say bgfx is gated by this job instead of still being un-gated.

Reviewed by Cursor Bugbot for commit e4a8c58. Bugbot is set up for automated code reviews on this repo. Configure here.

@apotema

apotema commented Jun 13, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #295 (merged), which added the dedicated cached bgfx-build job. Closing as redundant — the remaining gap is Android build coverage (the .so/APK are still manual-only), which I'm addressing in a separate Android-NDK CI job.

@apotema apotema closed this Jun 13, 2026
@apotema
apotema deleted the ci/286-bgfx-cached-example branch June 13, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: cached bgfx example build job

1 participant