* Migrate CI/CD to WarpBuild, consolidate test jobs Replace all macOS runner labels across workflows: - depot-macos-latest → warp-macos-15-arm64-6x - macos-15 → warp-macos-15-arm64-6x - macos-14 → warp-macos-14-arm64-6x Consolidates tests + tests-depot into a single tests job that runs unit tests, regressions, UI tests, and lag tests sequentially on one WarpBuild runner. Ubuntu jobs remain on ubuntu-latest. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Upgrade stale zig on runners that have an outdated version pre-installed WarpBuild macos-14 ships zig 0.15.1 but the project requires 0.15.2. The install step skipped because zig was found, just outdated. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Pin zig 0.15.2 via direct tarball instead of Homebrew Homebrew's zig bottle for macOS 14 (Sonoma) is stuck at 0.15.1 but the ghostty submodule requires 0.15.2. Download zig directly from ziglang.org to guarantee the correct version on all runner images. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix zig tarball URL: arch-os order is aarch64-macos, not macos-aarch64 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Create /usr/local/bin and /usr/local/lib before copying zig WarpBuild runners don't have /usr/local/lib by default. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add 20-min timeout to WarpBuild jobs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix UI test hang: stream output instead of variable capture, use GitHub runner for macOS 14 The OUTPUT=$(...) pattern buffers all xcodebuild output into a bash variable. For the full cmux scheme (build + UI tests), this can be hundreds of MB, causing the shell to hang. Replace with tee streaming. macOS 14 on WarpBuild consistently hangs (unit tests timeout at 20min vs 4min on macOS 15, same M4 Pro hardware). Use GitHub-hosted macos-14 runner for compat tests instead, which works on main today. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Split UI tests to GitHub-hosted runner (WarpBuild can't activate GUI apps) WarpBuild macOS VMs leave XCUIApplication stuck in "Running Background" state, causing every UI test to burn ~62s waiting for activation and timing out the job. Root cause: WarpBuild ephemeral VMs don't provide a full GUI session for app activation. Split CI into parallel jobs: - tests: WarpBuild (unit tests + regressions, ~6 min) - tests-ui: GitHub-hosted macos-15 (UI tests + lag regression) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Move tests-ui to WarpBuild with TCC permission grants Grant accessibility, post-event, and screen capture TCC permissions to Xcode and XCTest processes on WarpBuild ephemeral VMs. This should fix "Failed to activate application (Running Background)" errors that prevent XCUITests from bringing the app to foreground. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add GUI session diagnostics and DevToolsSecurity for WarpBuild UI tests Add session diagnostics (who, console user, GUI domain, WindowServer, loginwindow) to understand WarpBuild VM session state. Also enable DevToolsSecurity and security authorizationdb for XCTest process control. Try bootstrapping GUI session if missing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix TCC permissions: use Xcode-Helper + user DB (CircleCI approach) Previous TCC grants used wrong client IDs (com.apple.dt.Xcode) and only wrote to the system database. CircleCI's proven approach grants: - kTCCServiceAccessibility to com.apple.dt.Xcode-Helper (not Xcode) - kTCCServiceDeveloperTool to com.apple.Terminal - Both system AND user-level TCC databases Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Reduce UI test timeout to 15s for WarpBuild expected failures WarpBuild Virtualization.framework VMs cannot activate macOS GUI apps (XCUIApplication stuck "Running Background"). Tests still execute and report expected failures. But the 62s per-test activation timeout makes 30+ tests take 30+ minutes total. Set per-test timeout to 15s so expected failures resolve quickly. Full interactive UI test coverage runs via test-e2e.yml on GitHub-hosted runners with proper display support. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Replace XCUITest run with build + lag regression on WarpBuild WarpBuild Virtualization.framework VMs cannot activate macOS GUI apps (XCUIApplication stuck "Running Background" with 62s activation timeout per test). Tried TCC permissions, DevToolsSecurity, virtual display, reduced timeouts, nothing fixes the framework-level issue. Replace tests-ui job with tests-build-and-lag: - Build the full cmux scheme (verifies compilation) - Run workspace churn typing-lag regression (socket-based, no GUI) - XCUITests run via test-e2e.yml on GitHub-hosted runners Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Move macOS 14 compat to WarpBuild (no GitHub-hosted runners) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add diagnostic workflow to probe WarpBuild GUI activation Tests multiple app activation approaches on WarpBuild VMs: - open -a, NSWorkspace, NSRunningApplication.activate, osascript - Virtual display state before/after CGVirtualDisplay - TCC/accessibility permissions, Quartz session info - VM type detection This is a workflow_dispatch-only diagnostic to determine if XCUITest can work on WarpBuild with the right configuration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Trigger GUI probe on branch push (workflow_dispatch needs main) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Rewrite GUI probe with Swift (Python lacks AppKit on WarpBuild) v1 failed because WarpBuild's Python isn't a framework build and can't import AppKit/Quartz. v2 uses a compiled Swift binary to test NSRunningApplication.activate(), osascript, Quartz session state, display info, and AX trust. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * GUI probe v3: try 5 approaches to unlock WarpBuild screen 1. defaults write (screensaver, loginwindow, pmset) 2. automationmodetool enable-automationmode-without-authentication 3. CGSSessionSetScreenLocked private API + System Events keystroke 4. sysadminctl -screenLock off + keychain unlock 5. CGEvent simulation (mouse move + Return key to dismiss lock) Each approach is followed by an activation check to see if it worked. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Test GUI activation on macOS 14, 15, and 26 (Tahoe) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add DerivedData and GhosttyKit caching to CI workflows Major caching improvements across ci.yml and ci-macos-compat.yml: - Cache GhosttyKit.xcframework keyed on ghostty submodule SHA (skip download on cache hit) - Cache DerivedData keyed on OS + Xcode version + Package.resolved + project.pbxproj (enables incremental builds across runs) - Remove explicit DerivedData wipe (rely on cache key invalidation) - Use download-prebuilt-ghosttykit.sh in compat workflow too This should significantly speed up macOS 14 compat tests which were taking 20+ min due to full recompilation every run. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Bump macOS 14 compat timeout to 45 min for cold cache seeding The DerivedData cache wasn't saved because the job timed out at 30 min, causing the post-job cache save step to be skipped. 45 min gives enough headroom for the first uncached run to complete and seed the cache. Subsequent runs should be much faster with incremental builds. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Use Depot runners for E2E tests (WarpBuild has screen lock on macOS 15/26) WarpBuild VMs on macOS 15 and 26 have CGSSessionScreenIsLocked=1, which prevents XCUIApplication activation. Depot runners have working GUI activation. Can switch back to WarpBuild once they fix the VM images. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Skip smoke test on macOS 14 compat, remove GUI diagnostic workflow macOS 14 was slow because it built the full app (cmux scheme) on top of unit tests (cmux-unit scheme). Unit tests are the real compat check; smoke test runs on macOS 15 only. Also removes the temporary test-warpbuild-gui.yml diagnostic workflow. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Replace Sonoma with Tahoe in compat matrix, drop macOS 14 Swap macOS 14 (Sonoma) for macOS 26 (Tahoe). Smoke test runs on macOS 15 only (WarpBuild screen lock blocks app activation on 26). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Drop macOS 26 from compat matrix (zig 0.15.2 linker failure) Zig 0.15.2 can't link against the macOS 26 (Tahoe) SDK: undefined symbols for basic libc functions (_abort, _free, _fork, etc.). The zig toolchain needs an update to support Tahoe. Keep macOS 15 only for now. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Lawrence Chen <lawrencecchen@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
380 lines
15 KiB
YAML
380 lines
15 KiB
YAML
name: E2E test with video recording
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
ref:
|
|
description: Branch or SHA to test
|
|
required: false
|
|
default: ""
|
|
test_filter:
|
|
description: "Test class or class/method (e.g. UpdatePillUITests or UpdatePillUITests/testSomething)"
|
|
required: true
|
|
test_timeout:
|
|
description: "Per-test timeout in seconds"
|
|
required: false
|
|
default: "120"
|
|
record_video:
|
|
description: Record the virtual display during tests
|
|
required: false
|
|
default: true
|
|
type: boolean
|
|
runner:
|
|
description: "Runner OS (Depot runners for GUI activation support)"
|
|
required: false
|
|
default: "depot-macos-latest"
|
|
type: choice
|
|
options:
|
|
- depot-macos-latest
|
|
- depot-macos-14
|
|
|
|
jobs:
|
|
e2e:
|
|
runs-on: ${{ inputs.runner || 'depot-macos-latest' }}
|
|
timeout-minutes: 20
|
|
env:
|
|
TEST_REF: ${{ inputs.ref || github.ref }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
|
|
with:
|
|
ref: ${{ inputs.ref || github.ref }}
|
|
submodules: recursive
|
|
|
|
- name: Capture SHA
|
|
id: sha
|
|
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Select Xcode
|
|
run: |
|
|
set -euo pipefail
|
|
if [ -d "/Applications/Xcode.app/Contents/Developer" ]; then
|
|
XCODE_DIR="/Applications/Xcode.app/Contents/Developer"
|
|
else
|
|
XCODE_APP="$(ls -d /Applications/Xcode*.app 2>/dev/null | head -n 1 || true)"
|
|
if [ -n "$XCODE_APP" ]; then
|
|
XCODE_DIR="$XCODE_APP/Contents/Developer"
|
|
else
|
|
echo "No Xcode.app found under /Applications" >&2
|
|
exit 1
|
|
fi
|
|
fi
|
|
echo "DEVELOPER_DIR=$XCODE_DIR" >> "$GITHUB_ENV"
|
|
export DEVELOPER_DIR="$XCODE_DIR"
|
|
xcodebuild -version
|
|
xcrun --sdk macosx --show-sdk-path
|
|
|
|
- name: Download pre-built GhosttyKit.xcframework
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
set -euo pipefail
|
|
GHOSTTY_SHA=$(git -C ghostty rev-parse HEAD)
|
|
TAG="xcframework-$GHOSTTY_SHA"
|
|
URL="https://github.com/manaflow-ai/ghostty/releases/download/$TAG/GhosttyKit.xcframework.tar.gz"
|
|
echo "Downloading xcframework for ghostty $GHOSTTY_SHA"
|
|
MAX_RETRIES=30
|
|
RETRY_DELAY=20
|
|
for i in $(seq 1 $MAX_RETRIES); do
|
|
if curl -fSL -o GhosttyKit.xcframework.tar.gz "$URL"; then
|
|
echo "Download succeeded on attempt $i"
|
|
break
|
|
fi
|
|
if [ "$i" -eq "$MAX_RETRIES" ]; then
|
|
echo "Failed to download xcframework after $MAX_RETRIES attempts" >&2
|
|
exit 1
|
|
fi
|
|
echo "Attempt $i/$MAX_RETRIES failed, retrying in ${RETRY_DELAY}s..."
|
|
sleep $RETRY_DELAY
|
|
done
|
|
tar xzf GhosttyKit.xcframework.tar.gz
|
|
rm GhosttyKit.xcframework.tar.gz
|
|
test -d GhosttyKit.xcframework
|
|
|
|
- name: Install zig
|
|
run: |
|
|
ZIG_REQUIRED="0.15.2"
|
|
if command -v zig >/dev/null 2>&1 && zig version 2>/dev/null | grep -q "^${ZIG_REQUIRED}"; then
|
|
echo "zig ${ZIG_REQUIRED} already installed"
|
|
else
|
|
echo "Installing zig ${ZIG_REQUIRED} from tarball"
|
|
curl -fSL "https://ziglang.org/download/${ZIG_REQUIRED}/zig-aarch64-macos-${ZIG_REQUIRED}.tar.xz" -o /tmp/zig.tar.xz
|
|
tar xf /tmp/zig.tar.xz -C /tmp
|
|
sudo mkdir -p /usr/local/bin /usr/local/lib
|
|
sudo cp -f /tmp/zig-aarch64-macos-${ZIG_REQUIRED}/zig /usr/local/bin/zig
|
|
sudo cp -rf /tmp/zig-aarch64-macos-${ZIG_REQUIRED}/lib /usr/local/lib/zig
|
|
export PATH="/usr/local/bin:$PATH"
|
|
zig version
|
|
fi
|
|
|
|
- name: Create virtual display
|
|
run: |
|
|
set -euo pipefail
|
|
echo "=== Display before ==="
|
|
system_profiler SPDisplaysDataType 2>/dev/null || echo "(none)"
|
|
echo ""
|
|
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: Install ffmpeg
|
|
if: ${{ inputs.record_video }}
|
|
run: |
|
|
brew install --quiet ffmpeg
|
|
FFMPEG_PATH=$(which ffmpeg)
|
|
echo "ffmpeg: $FFMPEG_PATH"
|
|
ffmpeg -version | head -1
|
|
echo "FFMPEG_PATH=$FFMPEG_PATH" >> "$GITHUB_ENV"
|
|
|
|
- name: Grant TCC screen recording permission
|
|
if: ${{ inputs.record_video }}
|
|
continue-on-error: true
|
|
run: |
|
|
FFMPEG_BIN="${FFMPEG_PATH:-/opt/homebrew/bin/ffmpeg}"
|
|
|
|
# System-level TCC database (where kTCCServiceScreenCapture lives)
|
|
SYS_TCC="/Library/Application Support/com.apple.TCC/TCC.db"
|
|
if [ -f "$SYS_TCC" ]; then
|
|
echo "Granting screen capture in system TCC database"
|
|
for client in "$FFMPEG_BIN" /opt/homebrew/bin/ffmpeg /usr/local/bin/ffmpeg /usr/sbin/screencapture; do
|
|
sudo sqlite3 "$SYS_TCC" \
|
|
"INSERT OR REPLACE INTO access (service, client, client_type, auth_value, auth_reason, auth_version, csreq, policy_id, indirect_object_identifier_type, indirect_object_identifier, indirect_object_code_identity, flags, last_modified) VALUES ('kTCCServiceScreenCapture', '$client', 1, 2, 4, 1, NULL, NULL, 0, 'UNUSED', NULL, 0, $(date +%s));" 2>&1 || echo " (failed for $client)"
|
|
done
|
|
fi
|
|
|
|
# User-level TCC database (fallback)
|
|
USER_TCC="$HOME/Library/Application Support/com.apple.TCC/TCC.db"
|
|
if [ -f "$USER_TCC" ]; then
|
|
echo "Granting screen capture in user TCC database"
|
|
for client in "$FFMPEG_BIN" /opt/homebrew/bin/ffmpeg /usr/local/bin/ffmpeg; do
|
|
sqlite3 "$USER_TCC" \
|
|
"INSERT OR REPLACE INTO access (service, client, client_type, auth_value, auth_reason, auth_version, csreq, policy_id, indirect_object_identifier_type, indirect_object_identifier, indirect_object_code_identity, flags, last_modified) VALUES ('kTCCServiceScreenCapture', '$client', 1, 2, 4, 1, NULL, NULL, 0, 'UNUSED', NULL, 0, $(date +%s));" 2>&1 || echo " (failed for $client)"
|
|
done
|
|
fi
|
|
|
|
# Suppress Sequoia's ScreenCaptureApprovals prompt by pre-dating approval
|
|
APPROVALS_PLIST="$HOME/Library/Group Containers/group.com.apple.replayd/ScreenCaptureApprovals.plist"
|
|
if [ -d "$(dirname "$APPROVALS_PLIST")" ]; then
|
|
echo "Pre-dating ScreenCaptureApprovals"
|
|
# Set approval date far in the future so the monthly prompt never fires
|
|
defaults write "$APPROVALS_PLIST" "$FFMPEG_BIN" -date "3000-01-01T00:00:00Z" 2>&1 || echo " (failed)"
|
|
fi
|
|
|
|
- name: Clean DerivedData
|
|
run: rm -rf ~/Library/Developer/Xcode/DerivedData/GhosttyTabs-*
|
|
|
|
- name: Cache Swift packages
|
|
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
|
|
with:
|
|
path: .ci-source-packages
|
|
key: spm-${{ inputs.runner || 'depot-macos-latest' }}-${{ hashFiles('GhosttyTabs.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}
|
|
restore-keys: spm-${{ inputs.runner || 'depot-macos-latest' }}-
|
|
|
|
- name: Resolve Swift packages
|
|
run: |
|
|
set -euo pipefail
|
|
SOURCE_PACKAGES_DIR="$PWD/.ci-source-packages"
|
|
mkdir -p "$SOURCE_PACKAGES_DIR"
|
|
for attempt in 1 2 3; do
|
|
if xcodebuild -project GhosttyTabs.xcodeproj -scheme cmux-unit -configuration Debug \
|
|
-clonedSourcePackagesDirPath "$SOURCE_PACKAGES_DIR" \
|
|
-resolvePackageDependencies; then
|
|
exit 0
|
|
fi
|
|
if [ "$attempt" -eq 3 ]; then
|
|
echo "Failed to resolve Swift packages after 3 attempts" >&2
|
|
exit 1
|
|
fi
|
|
echo "Package resolution failed on attempt $attempt, retrying..."
|
|
sleep $((attempt * 5))
|
|
done
|
|
|
|
- name: Run UI tests
|
|
id: tests
|
|
env:
|
|
TEST_FILTER: ${{ inputs.test_filter }}
|
|
TEST_TIMEOUT: ${{ inputs.test_timeout || '120' }}
|
|
RECORD_VIDEO: ${{ inputs.record_video }}
|
|
run: |
|
|
set -euo pipefail
|
|
SOURCE_PACKAGES_DIR="$PWD/.ci-source-packages"
|
|
ONLY_TESTING="-only-testing:cmuxUITests/$TEST_FILTER"
|
|
|
|
# Start recording right before the test (after build/resolve)
|
|
if [ "$RECORD_VIDEO" = "true" ]; then
|
|
DEVLIST=$( ffmpeg -f avfoundation -list_devices true -i "" 2>&1 || true )
|
|
echo "Available devices:"
|
|
echo "$DEVLIST" | grep -E "AVFoundation|Capture screen"
|
|
|
|
SCREEN_INDEX=$( echo "$DEVLIST" | grep "Capture screen" | head -1 \
|
|
| sed 's/.*\[\([0-9]*\)\].*/\1/' )
|
|
SCREEN_INDEX="${SCREEN_INDEX:-0}"
|
|
echo "Using screen device index: $SCREEN_INDEX"
|
|
|
|
ffmpeg -f avfoundation -framerate 10 -capture_cursor 1 \
|
|
-i "${SCREEN_INDEX}:none" \
|
|
-c:v libx264 -preset ultrafast -pix_fmt yuv420p \
|
|
/tmp/test-recording-raw.mp4 </dev/null >/tmp/ffmpeg.log 2>&1 &
|
|
RECORD_PID=$!
|
|
echo "RECORD_PID=$RECORD_PID" >> "$GITHUB_ENV"
|
|
sleep 2
|
|
|
|
if kill -0 "$RECORD_PID" 2>/dev/null; then
|
|
echo "Recording started (PID $RECORD_PID)"
|
|
else
|
|
echo "::warning::ffmpeg screen recording failed to start"
|
|
cat /tmp/ffmpeg.log
|
|
fi
|
|
fi
|
|
|
|
set +e
|
|
OUTPUT=$(xcodebuild -project GhosttyTabs.xcodeproj -scheme cmux -configuration Debug \
|
|
-clonedSourcePackagesDirPath "$SOURCE_PACKAGES_DIR" \
|
|
-disableAutomaticPackageResolution \
|
|
-destination "platform=macOS" \
|
|
-maximum-test-execution-time-allowance "$TEST_TIMEOUT" \
|
|
$ONLY_TESTING test 2>&1)
|
|
EXIT_CODE=$?
|
|
set -e
|
|
|
|
echo "$OUTPUT"
|
|
|
|
# Save summary for the issue
|
|
SUMMARY=$(echo "$OUTPUT" | grep -E "(Test Suite|Executed|FAIL|PASS)" | tail -20)
|
|
{
|
|
echo "test_summary<<EOFSUM"
|
|
echo "$SUMMARY"
|
|
echo "EOFSUM"
|
|
} >> "$GITHUB_OUTPUT"
|
|
|
|
if [ "$EXIT_CODE" -eq 0 ]; then
|
|
echo "test_result=passed" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "test_result=failed" >> "$GITHUB_OUTPUT"
|
|
# Save full output for the issue body
|
|
{
|
|
echo "test_output<<EOFOUT"
|
|
echo "$OUTPUT" | tail -200
|
|
echo "EOFOUT"
|
|
} >> "$GITHUB_OUTPUT"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Stop recording and trim
|
|
if: ${{ always() && inputs.record_video && env.RECORD_PID != '' }}
|
|
run: |
|
|
# Stop ffmpeg cleanly
|
|
kill -INT "$RECORD_PID" 2>/dev/null || true
|
|
for i in $(seq 1 15); do
|
|
if ! kill -0 "$RECORD_PID" 2>/dev/null; then
|
|
echo "Recording stopped after ${i}s"
|
|
break
|
|
fi
|
|
sleep 1
|
|
done
|
|
kill -9 "$RECORD_PID" 2>/dev/null || true
|
|
|
|
echo "=== raw recording ==="
|
|
ls -lh /tmp/test-recording-raw.mp4 2>/dev/null || { echo "No recording file"; exit 0; }
|
|
|
|
# Trim: detect first non-black frame and cut from there
|
|
BLACK_END=$(ffmpeg -i /tmp/test-recording-raw.mp4 \
|
|
-vf "blackdetect=d=0.3:pic_th=0.95:pix_th=0.1" \
|
|
-an -f null - 2>&1 \
|
|
| grep "black_end" | tail -1 \
|
|
| sed 's/.*black_end:\([0-9.]*\).*/\1/' || true)
|
|
|
|
if [ -n "$BLACK_END" ] && [ "$BLACK_END" != "0" ]; then
|
|
echo "Trimming ${BLACK_END}s of black frames from start"
|
|
ffmpeg -y -i /tmp/test-recording-raw.mp4 -ss "$BLACK_END" \
|
|
-c:v libx264 -preset ultrafast -pix_fmt yuv420p \
|
|
/tmp/test-recording.mp4 2>/dev/null
|
|
else
|
|
echo "No black frames detected, using raw recording"
|
|
mv /tmp/test-recording-raw.mp4 /tmp/test-recording.mp4
|
|
fi
|
|
|
|
echo "=== final recording ==="
|
|
ls -lh /tmp/test-recording.mp4
|
|
# Print duration
|
|
ffprobe -v error -show_entries format=duration \
|
|
-of default=noprint_wrappers=1:nokey=1 /tmp/test-recording.mp4 2>/dev/null \
|
|
| xargs -I{} echo "Duration: {}s"
|
|
|
|
- name: Upload recording artifact
|
|
if: ${{ always() && inputs.record_video }}
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
|
with:
|
|
name: test-recording
|
|
path: /tmp/test-recording.mp4
|
|
if-no-files-found: warn
|
|
|
|
- name: Post results to cmux-dev-artifacts
|
|
if: always()
|
|
env:
|
|
GH_TOKEN: ${{ secrets.DEV_ARTIFACTS_TOKEN }}
|
|
TEST_RESULT: ${{ steps.tests.outputs.test_result || 'failed' }}
|
|
TEST_SUMMARY: ${{ steps.tests.outputs.test_summary }}
|
|
TEST_OUTPUT: ${{ steps.tests.outputs.test_output }}
|
|
TEST_FILTER: ${{ inputs.test_filter }}
|
|
COMMIT_SHA: ${{ steps.sha.outputs.sha }}
|
|
RUN_ID: ${{ github.run_id }}
|
|
RECORD_VIDEO: ${{ inputs.record_video }}
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
LABEL="$TEST_RESULT"
|
|
if [ "$TEST_RESULT" = "passed" ]; then
|
|
STATUS_EMOJI="PASSED"
|
|
else
|
|
STATUS_EMOJI="FAILED"
|
|
fi
|
|
|
|
REF_DISPLAY="${{ inputs.ref || github.ref_name }}"
|
|
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/$RUN_ID"
|
|
ARTIFACT_URL="$RUN_URL#artifacts"
|
|
|
|
BODY="**Status:** $STATUS_EMOJI
|
|
**Ref:** \`$REF_DISPLAY\`
|
|
**SHA:** [\`${COMMIT_SHA:0:12}\`](https://github.com/${{ github.repository }}/commit/$COMMIT_SHA)
|
|
**Test:** \`$TEST_FILTER\`
|
|
**Workflow run:** $RUN_URL"
|
|
|
|
if [ "$RECORD_VIDEO" = "true" ]; then
|
|
BODY="$BODY
|
|
**Recording:** [Download from artifacts]($ARTIFACT_URL)"
|
|
fi
|
|
|
|
if [ -n "$TEST_OUTPUT" ]; then
|
|
BODY="$BODY
|
|
|
|
<details><summary>Test output (last 200 lines)</summary>
|
|
|
|
\`\`\`
|
|
$TEST_OUTPUT
|
|
\`\`\`
|
|
|
|
</details>"
|
|
fi
|
|
|
|
if [ -n "$TEST_SUMMARY" ]; then
|
|
BODY="$BODY
|
|
|
|
\`\`\`
|
|
$TEST_SUMMARY
|
|
\`\`\`"
|
|
fi
|
|
|
|
ISSUE_URL=$(gh issue create \
|
|
--repo manaflow-ai/cmux-dev-artifacts \
|
|
--title "[$STATUS_EMOJI] $TEST_FILTER @ ${COMMIT_SHA:0:7} ($REF_DISPLAY)" \
|
|
--body "$BODY" \
|
|
--label "$LABEL")
|
|
|
|
echo "Issue posted: $ISSUE_URL"
|
|
echo "::notice title=Test Result Issue::$ISSUE_URL"
|