From 3a382cad9cfed023c3fb2769578e7e6e5e9020f7 Mon Sep 17 00:00:00 2001 From: Leo Li Date: Wed, 23 Sep 2026 19:35:08 -0700 Subject: [PATCH] ci: reuse the headless cmux-tui build in SDK conformance The seven-language conformance job spends about 5 of its 7 minutes compiling cmux-tui from scratch, including on runs where nothing under cmux-tui changed: any edit to one of the ~25 workflows in the path filter starts it. The build reads only the cmux-tui tree, the ghostty submodule and the pinned zig and Rust toolchains, so key the binary on exactly those and skip the compile on a hit. Pull requests only restore; pushes to main save. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/cmux-tui-sdks.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/cmux-tui-sdks.yml b/.github/workflows/cmux-tui-sdks.yml index 774c0ec0cd8c..7c3acfdf5139 100644 --- a/.github/workflows/cmux-tui-sdks.yml +++ b/.github/workflows/cmux-tui-sdks.yml @@ -600,12 +600,38 @@ jobs: working-directory: cmux-tui/bindings/typescript run: npm ci --no-audit --no-fund + # The build reads only the cmux-tui tree, the ghostty submodule, and the + # zig and Rust toolchains pinned here and in cmux-tui/rust-toolchain.toml. + # Keyed on exactly those, an unchanged tree skips a five-minute compile, + # which is every run started by a workflow-only edit. + - name: Key the headless cmux-tui build + id: headless-key + run: | + set -euo pipefail + echo "key=cmux-tui-headless-v1-${RUNNER_OS}-${RUNNER_ARCH}-zig0.16.0-$(git rev-parse HEAD:cmux-tui)-$(git rev-parse HEAD:ghostty)" >> "$GITHUB_OUTPUT" + + - name: Restore the headless cmux-tui build + id: headless-cache + uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: cmux-tui/target/debug/cmux-tui + key: ${{ steps.headless-key.outputs.key }} + - name: Build exact headless cmux-tui + if: ${{ steps.headless-cache.outputs.cache-hit != 'true' }} working-directory: cmux-tui run: | test "$(zig version)" = "0.16.0" cargo build -p cmux-tui --bin cmux-tui --locked + # Pull request caches stay read-only; main publishes the build they reuse. + - name: Save the headless cmux-tui build + if: ${{ github.event_name == 'push' && steps.headless-cache.outputs.cache-hit != 'true' }} + uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: cmux-tui/target/debug/cmux-tui + key: ${{ steps.headless-key.outputs.key }} + - name: Set up Zig for SDK conformance uses: mlugg/setup-zig@8d6198c65fb0feaa111df26e6b467fea8345e46f # v2.0.5 with: