Add virtual display for headless Depot runners (#721)

Depot macOS runners have no physical display, causing XCUITests to fail
with "Failed to activate application (current state: Running Background)".
This adds a small ObjC tool that creates a virtual display using the
private CGVirtualDisplay API before tests run.
This commit is contained in:
Lawrence Chen 2026-03-01 04:25:36 -08:00 committed by GitHub
parent 1b160dc5ca
commit 2b66a2f5c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 105 additions and 9 deletions

View file

@ -82,17 +82,20 @@ jobs:
rm GhosttyKit.xcframework.tar.gz
test -d GhosttyKit.xcframework
- name: Display diagnostics
- name: Create virtual display
run: |
echo "=== Screen resolution ==="
system_profiler SPDisplaysDataType 2>/dev/null || echo "No display info available"
set -euo pipefail
echo "=== Display before ==="
system_profiler SPDisplaysDataType 2>/dev/null || echo "(none)"
echo ""
echo "=== Window server ==="
/usr/sbin/system_profiler SPSoftwareDataType | grep -i "boot mode" || true
echo ""
echo "=== Accessibility permissions ==="
tccutil reset Accessibility 2>/dev/null || true
echo "Accessibility reset attempted"
clang -framework Foundation -framework CoreGraphics \
-o /tmp/create-virtual-display scripts/create-virtual-display.m
/tmp/create-virtual-display &
VDISPLAY_PID=$!
echo "VDISPLAY_PID=$VDISPLAY_PID" >> "$GITHUB_ENV"
sleep 3
echo "=== Display after ==="
system_profiler SPDisplaysDataType 2>/dev/null || echo "(none)"
- name: Clean DerivedData
run: |