Skip to content

ci: pre-boot simulator + retry test job to fix macos-26 launch flakiness #503

ci: pre-boot simulator + retry test job to fix macos-26 launch flakiness

ci: pre-boot simulator + retry test job to fix macos-26 launch flakiness #503

Workflow file for this run

name: CI
on:
push:
branches: [main]
paths-ignore:
- '**.md'
- 'docs/**'
- '.superpowers/**'
- 'LICENSE'
pull_request:
branches: [main]
paths-ignore:
- '**.md'
- 'docs/**'
- '.superpowers/**'
- 'LICENSE'
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: macos-26
steps:
- uses: actions/checkout@v6
- name: Install SwiftLint
run: brew install swiftlint
- name: Lint
run: swiftlint lint --reporter github-actions-logging
test:
runs-on: macos-26
steps:
- uses: actions/checkout@v6
- name: Copy Secrets
run: cp Secrets.xcconfig.example Secrets.xcconfig
- name: Boot Simulator
run: |
# Pre-boot so cold-boot latency doesn't eat xcodebuild's launch
# timeout. The macos-26 runner intermittently hung with the test
# runner never beginning execution when boot raced the test host.
xcrun simctl boot "iPhone 17 Pro" || true
xcrun simctl bootstatus "iPhone 17 Pro" -b
- name: Build and Test
run: |
# Retry once with a clean simulator re-boot in between: the
# macos-26 sim occasionally wedges on launch (tests never start).
# -quiet dropped so a genuine failure is actually diagnosable.
run_tests() {
xcodebuild test \
-workspace Pilgrim.xcworkspace \
-scheme Pilgrim \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 17 Pro' \
-skip-testing:ScreenshotTests \
-resultBundlePath "TestResults-$1.xcresult" \
CODE_SIGNING_ALLOWED=NO
}
if run_tests 1; then exit 0; fi
echo "::warning::Test run 1 failed — resetting simulator and retrying"
xcrun simctl shutdown "iPhone 17 Pro" || true
xcrun simctl boot "iPhone 17 Pro" || true
xcrun simctl bootstatus "iPhone 17 Pro" -b
run_tests 2
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results
path: TestResults-*.xcresult
retention-days: 7
if-no-files-found: ignore