Skip to content

UI tests (full)

UI tests (full) #40

Workflow file for this run

name: UI tests (full)
# The design-screenshot UI walkthroughs each boot the app in the simulator and
# are slow, so they run here instead of on every push: nightly, and on demand.
# CI (ci.yml) runs the fast unit suite on push/PR and skips CosignDemoUITests.
on:
schedule:
- cron: "0 7 * * *" # ~07:00 UTC nightly
workflow_dispatch:
concurrency:
group: ui-tests-${{ github.ref }}
cancel-in-progress: true
jobs:
ui:
name: Full UI walkthroughs
runs-on: macos-26
# Backstop: a hung simulator launch (DVTAssertions / IDELaunchiPhoneSimulator)
# once stalled xcodebuild for the full 6h default. Cap the whole job well below
# that; per-test timeouts below kill an individual hang so retries can proceed.
timeout-minutes: 50
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30 # stable
with:
targets: aarch64-apple-ios,aarch64-apple-ios-sim
- name: Cache cargo registry and target
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
workspaces: core
- name: Cache XCFramework + bindings
id: xcframework
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
Modules/CosignCore/Frameworks/CosignCore.xcframework
Modules/CosignCore/Sources/Generated
key: xcframework-${{ runner.os }}-${{ hashFiles('core/src/**', 'core/Cargo.toml', 'core/Cargo.lock', 'core/build.rs', 'core/uniffi.toml', 'scripts/build-rust.sh', 'scripts/build-xcframework.sh') }}
- name: Build XCFramework
if: steps.xcframework.outputs.cache-hit != 'true'
run: ./scripts/build-xcframework.sh
- name: Install Tuist
run: brew install tuist
- name: Generate Xcode project
run: tuist generate --no-open
- name: Pick an available iPhone simulator
id: sim
run: |
LINE=$(xcrun simctl list devices available | grep -E " iPhone [0-9]+" | head -1)
DEVICE=$(echo "$LINE" | sed 's/^[ \t]*//' | sed 's/ (.*//')
UDID=$(echo "$LINE" | grep -oiE "[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}")
echo "Selected simulator: $DEVICE ($UDID)"
echo "device=$DEVICE" >> "$GITHUB_OUTPUT"
echo "udid=$UDID" >> "$GITHUB_OUTPUT"
# Boot the target simulator explicitly and wait until it is fully booted
# before testing, so the test runner never races a cold launch. A stalled
# cold launch is what produces the intermittent "Failed to send signal 19
# to process" hangs on the hosted runners.
- name: Boot simulator
run: xcrun simctl bootstatus "${{ steps.sim.outputs.udid }}" -b
- name: Build for testing
env:
SIMULATOR_ID: ${{ steps.sim.outputs.udid }}
run: |
xcodebuild build-for-testing \
-workspace Cosign.xcworkspace \
-scheme Cosign-Workspace \
-destination "platform=iOS Simulator,id=$SIMULATOR_ID" \
-configuration Debug
# Run the walkthroughs serially on the single booted simulator. These
# capture-heavy tests each run ~2-3 min; running clones concurrently made
# them contend for the runner's CPU and tip over the per-test timeout, so
# serial (full CPU per test, no clones) is both faster per test and more
# stable. The 50-minute job cap still bounds total runtime.
- name: Run UI walkthroughs
env:
SIMULATOR_ID: ${{ steps.sim.outputs.udid }}
run: |
xcodebuild test-without-building \
-workspace Cosign.xcworkspace \
-scheme Cosign-Workspace \
-destination "platform=iOS Simulator,id=$SIMULATOR_ID" \
-only-testing:CosignDemoUITests \
-parallel-testing-enabled NO \
-retry-tests-on-failure \
-test-iterations 2 \
-test-timeouts-enabled YES \
-default-test-execution-time-allowance 300 \
-maximum-test-execution-time-allowance 600