Skip to content

Speed up macOS CI lanes - #6490

Merged
lawrencecchen merged 2 commits into
mainfrom
task-speed-up-ci-macos-nightly-app-host-tests
Jun 20, 2026
Merged

lawrencecchen merged 2 commits into
mainfrom
task-speed-up-ci-macos-nightly-app-host-tests

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Jun 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Run the nightly Ghostty CLI helper build in parallel with the universal Release app build, then wait and verify before injection.
  • Remove unused Zig setup from app-host unit-test shards and move focused one-off app-host/CLI gates from shard 1 to shard 4.
  • Add a workflow guard for the app-host CI shape and update the nightly universal guard.

Testing

  • ./tests/test_ci_app_host_workflow_shape.sh
  • bash ./tests/test_nightly_universal_build.sh
  • python3 scripts/ci/cmux_unit_test_shard.py --validate
  • bash -n tests/test_ci_app_host_workflow_shape.sh tests/test_nightly_universal_build.sh
  • ruby -e 'require "yaml"; ARGV.each { |p| YAML.load_file(p) }; puts "yaml ok"' .github/workflows/ci.yml .github/workflows/nightly.yml\n- actionlint .github/workflows/ci.yml .github/workflows/nightly.yml\n- git diff --check\n- /Users/lawrence/fun/cmuxterm-hq/skills/autoreview/scripts/autoreview --mode branch --base origin/main\n\n## Issues\n- Task: speed up Nightly macOS build / build-sign-notarize-nightly and CI / app-host unit tests (1/4)\n

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Note

Low Risk
Changes are limited to CI workflow timing and shard placement; release artifacts and regression gates stay the same, with no application or security logic touched.

Overview
Nightly no longer runs the universal Ghostty CLI helper as a separate step before the Release app build. One step starts build-ghostty-cli-helper.sh --universal in the background (with HELPER_DEVELOPER_DIR), runs xcodebuild with CMUX_SKIP_ZIG_BUILD=1, then waits on the helper, prints its log, and fails if either side failed. Injection and arch checks are unchanged.

App-host unit tests drop Zig install and the Zig package cache on every shard (tests already use prebuilt GhosttyKit and CMUX_SKIP_ZIG_BUILD=1). Focused one-off gates (split-theme, proxy mirror, Option/Alt mods, theme picker helper, CLI no-socket regressions) move off shard 1 onto shard 4 via CMUX_APP_HOST_FOCUSED_REGRESSION_SHARD and fromJSON(env.…) in step if conditions.

tests/test_nightly_universal_build.sh now asserts the combined nightly step includes parallel helper build, wait, and log output.

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


Summary by cubic

Speed up macOS CI by building the Nightly Release app and universal Ghostty CLI helper in one parallel step, and by rebalancing app-host unit-test shards while removing unused Zig setup. Satisfies the task to speed up Nightly macOS builds and app-host unit tests.

  • Refactors
    • Nightly: combine app and universal helper builds; run helper in background with DEVELOPER_DIR override; wait and show log; assert arm64/x86_64; fail if either build fails; use CMUX_SKIP_ZIG_BUILD=1 only for the in-Xcode helper; update tests/test_nightly_universal_build.sh to verify combined step, wait, and log.
    • App-host unit tests: move focused regressions to shard 4 via CMUX_APP_HOST_FOCUSED_REGRESSION_SHARD and fromJSON(env.CMUX_APP_HOST_FOCUSED_REGRESSION_SHARD); drop Zig install and cache; keep CMUX_SKIP_ZIG_BUILD=1.

Written for commit 6288038. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Chores
    • Optimized macOS continuous integration workflow with environment-based shard selection for focused regression tests, improving workflow configuration and maintainability.
    • Improved nightly build process efficiency by parallelizing universal binary helper compilation with the primary application build step, reducing total build time.
    • Updated test validation suite to reflect the consolidated build workflow structure and verify all build components correctly.

@vercel

vercel Bot commented Jun 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Jun 20, 2026 8:36am
cmux-staging Building Building Preview, Comment Jun 20, 2026 8:36am

@coderabbitai

coderabbitai Bot commented Jun 20, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The CI workflow gains a configurable CMUX_APP_HOST_FOCUSED_REGRESSION_SHARD: "4" env variable that replaces the hardcoded matrix.shard == 1 guard on five focused regression steps. The nightly workflow eliminates the standalone Ghostty CLI helper build step, merging it as an async background process into the universal app build step with combined exit-code checking. The nightly test script is updated to reflect the new step name and async verification signals.

Changes

App-host focused regression shard gating

Layer / File(s) Summary
Env variable declaration and shard condition updates
.github/workflows/ci.yml
Adds CMUX_APP_HOST_FOCUSED_REGRESSION_SHARD: "4" to the app-host job env block, reorders setup so "Install Rust" appears in that region (removing "Install zig"), and rewrites the if condition on five focused regression steps from matrix.shard == 1 to matrix.shard == fromJSON(env.CMUX_APP_HOST_FOCUSED_REGRESSION_SHARD).

Nightly combined universal build

Layer / File(s) Summary
Combined universal app and CLI helper build step
.github/workflows/nightly.yml
Removes the isolated "Build universal Ghostty CLI helper" step and merges the helper build as a background process into a single "Build universal nightly app and Ghostty CLI helper (Release)" step, with log capture, wait-based PID tracking, separate exit-code collection, and retained lipo slice verification.
Nightly build test updates
tests/test_nightly_universal_build.sh
Updates the awk step-name matcher to the combined step title and expands the helper verification block to require --universal invocation evidence, both arm64/x86_64 lipo slices, a wait "$HELPER_PID", and a cat "$HELPER_LOG".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

  • manaflow-ai/cmux#5077: Both PRs modify .github/workflows/nightly.yml around building and verifying the universal Ghostty CLI helper, with lipo-based slice evidence and changes to how/where the helper build is performed.
  • manaflow-ai/cmux#5694: Both PRs touch tests/test_nightly_universal_build.sh to assert Ghostty CLI helper universal build behavior in the nightly workflow's combined build step.
  • manaflow-ai/cmux#6464: Both PRs modify the macOS CI unit-test sharding flow in .github/workflows/ci.yml, altering which matrix.shard runs the app-host focused regression steps.

Poem

🐇 Hop, hop! Shard four takes the gate,
No longer locked to shard one's fate.
The nightly helper runs in the back,
While xcodebuild stays on track.
Both exit codes checked before the end—
This rabbit approves every blend! ✨


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Cmux Source Artifacts ❌ Error Commit adds source control artifacts violating rules: .claude/scheduled_tasks.lock (IDE session lock), 25 .claude/commands/ and .claude/skills/ files (IDE workspace), and .agents/skills (agent arti... Remove .claude/, .agents/skills, and add these patterns to .gitignore; otherwise keep only legitimate workflow and test file changes from the PR.
✅ Passed checks (22 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Speed up macOS CI lanes' directly aligns with the PR's main objective of optimizing macOS CI performance through parallelization and workflow reorganization.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Swift Actor Isolation ✅ Passed PR modifies only CI workflows (YAML) and shell test scripts; no production Swift code is changed, so Swift actor isolation check is not applicable.
Cmux Swift Blocking Runtime ✅ Passed PR modifies only CI workflow YAML and shell script tests, not production Swift code. Custom check for Swift blocking runtime does not apply.
Cmux Expensive Synchronous Load ✅ Passed This PR contains only CI/CD workflow (YAML) and test script (bash) changes; no Swift production source code is modified, so the expensive synchronous loader check is not applicable.
Cmux Cache Substitution Correctness ✅ Passed Check is not applicable: PR contains only YAML workflow files and bash test scripts, not production Swift, TypeScript, or JavaScript code changes.
Cmux No Hacky Sleeps ✅ Passed PR only modifies GitHub Actions YAML (out of scope per rule) and test files (allowed). No hacky sleeps added to production runtime code.
Cmux Algorithmic Complexity ✅ Passed PR modifies only YAML workflow definitions (.github/workflows/) and shell test harnesses (tests/*.sh), which are explicitly exempt from algorithmic complexity rules per the rule's Pass section: "Te...
Cmux Swift Concurrency ✅ Passed No Swift source code changes present in PR; all modifications are CI/CD workflows (YAML) and shell test scripts, making the Swift concurrency check not applicable.
Cmux Swift @Concurrent ✅ Passed PR contains no Swift code changes; only YAML workflows and bash test scripts. Custom check for Swift @concurrent annotations is not applicable.
Cmux Swift File And Package Boundaries ✅ Passed PR modifies only CI workflow YAML and shell test scripts; no Swift files are present, so the swift-file-package-boundaries rule does not apply.
Cmux Swiftpm Lockfiles ✅ Passed PR complies with SwiftPM Package.resolved policy: cmux-owned .gitignore files don't ignore Package.resolved, all Package.swift dependency changes have matching package-local Package.resolved diffs,...
Cmux Swift Logging ✅ Passed PR modifies only CI workflow YAML files and shell test scripts, with no Swift code changes; Swift logging check is not applicable.
Cmux User-Facing Error Privacy ✅ Passed All changes are CI workflow orchestration (.github/workflows/) and test scripts (tests/), which are allowed categories per the rule. No user-facing error messages violate the privacy policy.
Cmux Full Internationalization ✅ Passed PR modifies only CI workflows (.github/workflows/ci.yml, .github/workflows/nightly.yml) and test files (tests/test_nightly_universal_build.sh). Per full-internationalization.md, these are allowed a...
Cmux Swiftui State Layout ✅ Passed Check does not apply: PR modifies only YAML CI workflows and shell test scripts, not any Swift/SwiftUI code subject to state layout rules.
Cmux Architecture Rethink ✅ Passed PR contains only CI workflow YAML and shell script changes; no Swift source code modifications present, making the architectural rethink check inapplicable.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed No Swift source files are modified in this PR; all changes are YAML workflows and shell test scripts. The check for Swift auxiliary window close shortcuts is not applicable.
Cmux No Test Or Debug Seam In Production Source ✅ Passed PR modifies only CI workflows (.yml) and test shell scripts (.sh), not Swift source files under Sources/, so the test/debug seam check does not apply.
Description check ✅ Passed The pull request description comprehensively covers all required template sections: Summary clearly explains three key changes, Testing section lists specific validation commands executed, and Checklist indicates completed verification steps.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch task-speed-up-ci-macos-nightly-app-host-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1244993. Configure here.

Comment thread .github/workflows/nightly.yml
@greptile-apps

greptile-apps Bot commented Jun 20, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR speeds up macOS CI by parallelizing two previously sequential nightly build steps and rebalancing app-host unit-test shards. No production Swift or runtime code is touched — all changes are confined to GitHub Actions YAML and one test-guard shell script.

  • nightly.yml: The standalone "Build universal Ghostty CLI helper" step is folded into the app-build step; the helper script now runs in a background subshell (>\"$HELPER_LOG\" 2>&1 &) while xcodebuild runs concurrently. After xcodebuild finishes the script waits for the helper PID, surfaces its log with cat, and fails if either leg exits non-zero. The inject and arch-verify steps that follow are unchanged.
  • ci.yml: Introduces CMUX_APP_HOST_FOCUSED_REGRESSION_SHARD=4 and rewires five focused regression gates from shard 1 to shard 4 via fromJSON(env.CMUX_APP_HOST_FOCUSED_REGRESSION_SHARD). Removes the now-dead Zig install and Zig package-cache steps from the app-host shards that already declare CMUX_SKIP_ZIG_BUILD=1.
  • tests/test_nightly_universal_build.sh: Updated awk patterns match the merged step name and add saw_wait/saw_log assertions so the guard will catch any future regression that splits the builds back apart or drops the synchronization.

Confidence Score: 5/5

Safe to merge — workflow-only changes with no production Swift or runtime code affected.

The parallelization in nightly.yml uses proper wait $HELPER_PID synchronization, captures the helper exit code independently, surfaces its log unconditionally, and fails the step if either build leg fails — the inject and arch-verify gates that guard release integrity are completely untouched. The shard rebalancing in ci.yml uses the correct fromJSON() coercion to compare the integer matrix value against the string env var, and the removed Zig steps were already redundant given the job-level CMUX_SKIP_ZIG_BUILD=1. The test guard is updated in lockstep.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/nightly.yml Merges the separate helper-build step into the app-build step; launches helper in a background subshell, captures its log to RUNNER_TEMP, runs xcodebuild concurrently, then waits for both with independent status tracking and explicit failure messages before the inject step.
.github/workflows/ci.yml Adds CMUX_APP_HOST_FOCUSED_REGRESSION_SHARD=4 env var and migrates five focused regression gates from shard 1 to shard 4 via fromJSON() comparison; removes unused Zig install and Zig package cache steps from app-host shards that already set CMUX_SKIP_ZIG_BUILD=1.
tests/test_nightly_universal_build.sh Updates awk patterns to match the new combined step name and adds saw_wait/saw_log assertions to guard that the workflow uses proper background-process synchronization (wait + cat) rather than a separate sequential step.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant GHA as GitHub Actions
    participant Helper as build-ghostty-cli-helper.sh (background)
    participant XC as xcodebuild (Release)
    participant Inject as Inject universal helper

    GHA->>Helper: launch in background subshell → HELPER_LOG
    GHA->>XC: "CMUX_SKIP_ZIG_BUILD=1 xcodebuild (parallel)"
    XC-->>GHA: APP_STATUS
    GHA->>Helper: wait $HELPER_PID → HELPER_STATUS
    GHA->>GHA: cat $HELPER_LOG (surface output)
    GHA->>GHA: "fail if APP_STATUS != 0"
    GHA->>GHA: "fail if HELPER_STATUS != 0"
    GHA->>Inject: install -m 755 /tmp/cmux-ghostty-helper-universal $DEST
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant GHA as GitHub Actions
    participant Helper as build-ghostty-cli-helper.sh (background)
    participant XC as xcodebuild (Release)
    participant Inject as Inject universal helper

    GHA->>Helper: launch in background subshell → HELPER_LOG
    GHA->>XC: "CMUX_SKIP_ZIG_BUILD=1 xcodebuild (parallel)"
    XC-->>GHA: APP_STATUS
    GHA->>Helper: wait $HELPER_PID → HELPER_STATUS
    GHA->>GHA: cat $HELPER_LOG (surface output)
    GHA->>GHA: "fail if APP_STATUS != 0"
    GHA->>GHA: "fail if HELPER_STATUS != 0"
    GHA->>Inject: install -m 755 /tmp/cmux-ghostty-helper-universal $DEST
Loading

Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

@lawrencecchen
lawrencecchen force-pushed the task-speed-up-ci-macos-nightly-app-host-tests branch from 1244993 to 80b3895 Compare June 20, 2026 07:54

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/test_nightly_universal_build.sh`:
- Around line 23-32: The awk pattern matching in this block validates that the
universal helper is built and various assertions are checked, but does not
verify that a non-zero HELPER_STATUS exit code is actually enforced to fail the
workflow step. Add a new pattern matcher variable (similar to saw_build,
saw_arm64_assert, saw_x86_assert, saw_wait, and saw_log) that searches for the
pattern or mechanism in the workflow that enforces the HELPER_STATUS failure
gate, then include this new variable in the final END block exit condition
alongside the existing saw_build, saw_arm64_assert, saw_x86_assert, saw_wait,
and saw_log checks to ensure the regression test truly validates combined
exit-code handling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 581cafd9-239a-484d-8a91-462db8f58e31

📥 Commits

Reviewing files that changed from the base of the PR and between 1244993 and 80b3895.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • .github/workflows/nightly.yml
  • tests/test_nightly_universal_build.sh

Comment on lines +23 to +32
/^ - name: Build universal nightly app and Ghostty CLI helper \(Release\)/ { in_helper=1; next }
in_helper && /^ - name:/ { in_helper=0 }
in_helper && /build-ghostty-cli-helper\.sh --universal/ { saw_build=1 }
in_helper && /helper missing arm64 slice/ { saw_arm64_assert=1 }
in_helper && /helper missing x86_64 slice/ { saw_x86_assert=1 }
END { exit !(saw_build && saw_arm64_assert && saw_x86_assert) }
in_helper && /wait "\$HELPER_PID"/ { saw_wait=1 }
in_helper && /cat "\$HELPER_LOG"/ { saw_log=1 }
END { exit !(saw_build && saw_arm64_assert && saw_x86_assert && saw_wait && saw_log) }
' "$WORKFLOW_FILE"; then
echo "FAIL: nightly workflow must build and verify the real universal Ghostty helper"
echo "FAIL: nightly workflow must build and verify the real universal Ghostty helper alongside the app build"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Assert helper failure is enforced, not just observed.

This block verifies wait and log output, but not that a non-zero HELPER_STATUS must fail the step. Add a matcher for the helper failure gate so the regression test truly protects combined exit-code handling.

Proposed patch
 if ! awk '
   /^      - name: Build universal nightly app and Ghostty CLI helper \(Release\)/ { in_helper=1; next }
   in_helper && /^      - name:/ { in_helper=0 }
   in_helper && /build-ghostty-cli-helper\.sh --universal/ { saw_build=1 }
   in_helper && /helper missing arm64 slice/ { saw_arm64_assert=1 }
   in_helper && /helper missing x86_64 slice/ { saw_x86_assert=1 }
   in_helper && /wait "\$HELPER_PID"/ { saw_wait=1 }
   in_helper && /cat "\$HELPER_LOG"/ { saw_log=1 }
-  END { exit !(saw_build && saw_arm64_assert && saw_x86_assert && saw_wait && saw_log) }
+  in_helper && /if \[ "\$HELPER_STATUS" -ne 0 \]; then/ { saw_helper_fail_gate=1 }
+  in_helper && /exit "\$HELPER_STATUS"/ { saw_helper_fail_exit=1 }
+  END { exit !(saw_build && saw_arm64_assert && saw_x86_assert && saw_wait && saw_log && saw_helper_fail_gate && saw_helper_fail_exit) }
 ' "$WORKFLOW_FILE"; then
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/test_nightly_universal_build.sh` around lines 23 - 32, The awk pattern
matching in this block validates that the universal helper is built and various
assertions are checked, but does not verify that a non-zero HELPER_STATUS exit
code is actually enforced to fail the workflow step. Add a new pattern matcher
variable (similar to saw_build, saw_arm64_assert, saw_x86_assert, saw_wait, and
saw_log) that searches for the pattern or mechanism in the workflow that
enforces the HELPER_STATUS failure gate, then include this new variable in the
final END block exit condition alongside the existing saw_build,
saw_arm64_assert, saw_x86_assert, saw_wait, and saw_log checks to ensure the
regression test truly validates combined exit-code handling.

@lawrencecchen
lawrencecchen merged commit 19ca48e into main Jun 20, 2026
28 of 30 checks passed
@lawrencecchen
lawrencecchen deleted the task-speed-up-ci-macos-nightly-app-host-tests branch June 20, 2026 08:23
@lawrencecchen
lawrencecchen restored the task-speed-up-ci-macos-nightly-app-host-tests branch July 18, 2026 10:25

This branch was successfully deployed

1 active deployment
Preview – cmux — 62880384 Deployed Jun 20, 2026 by vercel[bot]
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.

1 participant