diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f5112bc..77831836 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -488,6 +488,36 @@ jobs: -destination "platform=macOS" \ build-for-testing + - name: Create persistent virtual display + run: | + set -euo pipefail + HELPER_PATH="/tmp/create-virtual-display" + clang -framework Foundation -framework CoreGraphics \ + -o "$HELPER_PATH" scripts/create-virtual-display.m + + VDISPLAY_READY="/tmp/cmux-vdisplay-persistent.ready" + VDISPLAY_ID_PATH="/tmp/cmux-vdisplay-persistent.id" + rm -f "$VDISPLAY_READY" "$VDISPLAY_ID_PATH" + + "$HELPER_PATH" \ + --modes "1920x1080" \ + --ready-path "$VDISPLAY_READY" \ + --display-id-path "$VDISPLAY_ID_PATH" \ + > /tmp/cmux-vdisplay-persistent.log 2>&1 & + echo "VDISPLAY_PERSISTENT_PID=$!" >> "$GITHUB_ENV" + + echo "Waiting for persistent virtual display..." + for i in $(seq 1 24); do + if [ -f "$VDISPLAY_READY" ]; then break; fi + sleep 0.5 + done + if [ ! -f "$VDISPLAY_READY" ]; then + echo "ERROR: Persistent virtual display not ready after 12s" >&2 + cat /tmp/cmux-vdisplay-persistent.log 2>/dev/null || true + exit 1 + fi + echo "Persistent virtual display ready: ID=$(cat "$VDISPLAY_ID_PATH")" + - name: Run display resolution churn UI regression run: | set -euo pipefail @@ -661,4 +691,12 @@ jobs: -destination "platform=macOS" \ -maximum-test-execution-time-allowance 120 \ -only-testing:cmuxUITests/BrowserPaneNavigationKeybindUITests/testCmdFFocusesBrowserFindFieldAfterCmdDCmdLNavigation \ - test + test-without-building + + - name: Cleanup persistent virtual display + if: always() + run: | + if [ -n "${VDISPLAY_PERSISTENT_PID:-}" ]; then + kill "$VDISPLAY_PERSISTENT_PID" >/dev/null 2>&1 || true + fi + rm -f /tmp/cmux-vdisplay-persistent.ready /tmp/cmux-vdisplay-persistent.id /tmp/cmux-vdisplay-persistent.log