Skip to content

fix: add MAIN/LAUNCHER flags to Android launcher activity resolver #266

fix: add MAIN/LAUNCHER flags to Android launcher activity resolver

fix: add MAIN/LAUNCHER flags to Android launcher activity resolver #266

Workflow file for this run

name: iOS
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
integration-ios:
name: Integration Tests
runs-on: macos-26
timeout-minutes: 80
continue-on-error: true
env:
IOS_RUNTIME_VERSION: '26.2'
DERIVED_DATA_PATH: ${{ github.workspace }}/.tmp/ios-runner-derived
AGENT_DEVICE_IOS_RUNNER_DERIVED_PATH: ${{ github.workspace }}/.tmp/ios-runner-derived
AGENT_DEVICE_IOS_SIMCTL_LIST_TIMEOUT_MS: "60000"
AGENT_DEVICE_DAEMON_TIMEOUT_MS: "300000"
AGENT_DEVICE_IOS_BOOT_TIMEOUT_MS: "180000"
AGENT_DEVICE_IOS_APP_LAUNCH_TIMEOUT_MS: "60000"
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup toolchain
uses: ./.github/actions/setup-node-pnpm
- name: Resolve Xcode cache key
id: xcode
run: |
set -euo pipefail
XCODE_VERSION="$(xcodebuild -version | tr '\n' ' ' | sed -E 's/[[:space:]]+/ /g; s/[[:space:]]$//')"
XCODE_KEY="$(echo "$XCODE_VERSION" | tr ' ' '-' | tr -cd '[:alnum:]._-')"
echo "key=$XCODE_KEY" >> "$GITHUB_OUTPUT"
- name: Resolve prebuild source hash
id: source-hash
run: echo "value=${{ hashFiles('ios-runner/**', 'package.json', 'pnpm-lock.yaml') }}" >> "$GITHUB_OUTPUT"
- name: Cache iOS runner prebuilt
id: restore-prebuilt
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.2.3
with:
path: ${{ env.DERIVED_DATA_PATH }}
key: ios-runner-prebuilt-${{ steps.xcode.outputs.key }}-ios-${{ env.IOS_RUNTIME_VERSION }}-${{ steps.source-hash.outputs.value }}
- name: Resolve agent-device home
id: ios-agent-home
run: echo "dir=$HOME/.agent-device" >> "$GITHUB_OUTPUT"
- name: Build iOS integration artifacts
if: steps.restore-prebuilt.outputs.cache-hit != 'true'
run: |
set -euo pipefail
rm -rf "$DERIVED_DATA_PATH"
xcodebuild build-for-testing \
-project ios-runner/AgentDeviceRunner/AgentDeviceRunner.xcodeproj \
-scheme AgentDeviceRunner \
-destination "platform=iOS Simulator,name=iPhone 17 Pro,OS=${IOS_RUNTIME_VERSION}" \
-derivedDataPath "$DERIVED_DATA_PATH"
- name: Resolve and boot iOS test simulator
run: |
set -euo pipefail
RUNTIME_TOKEN="SimRuntime.iOS-${IOS_RUNTIME_VERSION//./-}"
export RUNTIME_TOKEN
UDID="$(
xcrun simctl list devices -j | node -e '
const fs = require("node:fs");
const runtimeToken = process.env.RUNTIME_TOKEN;
const payload = JSON.parse(fs.readFileSync(0, "utf8"));
const entries = Object.entries(payload.devices ?? {});
const iosRuntimes = entries.filter(([runtime]) => runtime.includes("SimRuntime.iOS-"));
const runtimeMatches = iosRuntimes.filter(([runtime]) => runtime.includes(runtimeToken));
const pool = runtimeMatches.length > 0 ? runtimeMatches : iosRuntimes;
const available = pool.flatMap(([runtime, devices]) =>
(devices ?? [])
.filter((device) => device.isAvailable)
.map((device) => ({ ...device, runtime })),
);
const preferred =
available.find((device) => device.state === "Booted" && device.name === "iPhone 17 Pro") ??
available.find((device) => device.name === "iPhone 17 Pro") ??
available.find((device) => device.state === "Booted") ??
available[0];
if (!preferred?.udid) process.exit(1);
process.stdout.write(preferred.udid);
'
)"
xcrun simctl shutdown all || true
xcrun simctl boot "$UDID" || true
xcrun simctl bootstatus "$UDID" -b
- name: Run iOS integration test
run: node --test test/integration/ios.test.ts
- name: Upload iOS artifacts
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ios-artifacts
if-no-files-found: ignore
path: |
${{ steps.ios-agent-home.outputs.dir }}/daemon.log
${{ steps.ios-agent-home.outputs.dir }}/sessions/**
test/artifacts/**
test/screenshots/**