Files
hapi/.github/workflows/ios.yml
T
AnanovoandGitHub 5ed3d14f88 test(ios): capture intermittent transcript layout diagnostics (#2325)
* test(ios): capture intermittent transcript layout diagnostics

* fix(ci): keep iPad diagnostics running after failures

* ci: retry iOS diagnostics after transient simulator failures
2026-11-09 12:03:47 +08:00

106 lines
4.9 KiB
YAML

name: ios
on:
push:
branches:
- main
paths:
- 'ios/**'
- 'shared/fixtures/**'
- '.github/workflows/ios.yml'
pull_request:
paths:
- 'ios/**'
- 'shared/fixtures/**'
- '.github/workflows/ios.yml'
concurrency:
group: ios-${{ github.ref }}
cancel-in-progress: true
jobs:
# Xcode 27.1+ is required: the app uses iOS 27.1 SDK APIs (e.g. UIHingeInteraction).
package-tests:
runs-on: xcode-27
steps:
- uses: actions/checkout@v4
- name: Show toolchain versions
run: |
xcodebuild -version
swift --version
- name: Run HapiKit package tests
run: swift test --package-path ios/Packages/HapiKit
app-build:
runs-on: xcode-27
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
- name: Show toolchain versions
run: xcodebuild -version
- name: Check manual localization catalog
env:
PYTHONDONTWRITEBYTECODE: '1'
run: |
python3 ios/scripts/localizations.py --check
python3 -m unittest discover -s ios/scripts/tests -p 'test_localizations.py'
- name: Build Hapi app for iOS Simulator
run: xcodebuild build -project ios/Hapi.xcodeproj -scheme Hapi -destination 'generic/platform=iOS Simulator' CODE_SIGNING_ALLOWED=NO
- name: Transcript layout regression tests
env:
HAPI_TEST_RESULT_BUNDLE_PATH: ${{ runner.temp }}/iphone-transcript.xcresult
run: ios/scripts/test-transcript.sh
- name: iPad navigation and layout regression tests
if: ${{ !cancelled() }}
env:
HAPI_TEST_DEVICE_TYPE: com.apple.CoreSimulator.SimDeviceType.iPad-Air-11-inch-M2
HAPI_TEST_RESULT_BUNDLE_PATH: ${{ runner.temp }}/ipad-regression.xcresult
run: >-
ios/scripts/test-transcript.sh
-only-testing:HapiTests/SessionNavigationTests
-only-testing:HapiTests/SessionSplitPresentationTests
-only-testing:HapiTests/TranscriptTypographyTests
-only-testing:HapiTests/TranscriptGeometryTests
- name: Build Hapi app for Mac Catalyst
run: xcodebuild build -project ios/Hapi.xcodeproj -scheme Hapi -destination 'platform=macOS,variant=Mac Catalyst' CODE_SIGNING_ALLOWED=NO
# Dynamic Type overrides do not scale Mac-idiom windows, so the
# typography suite stays on the iOS simulators above.
# Keep each suite in a separate bounded step so a hang identifies
# the responsible suite and cannot hold the job for hours.
- name: Mac navigation regression tests
timeout-minutes: 20
run: >-
xcodebuild test -project ios/Hapi.xcodeproj -scheme Hapi
-destination 'platform=macOS,variant=Mac Catalyst'
-enableCodeCoverage NO -parallel-testing-enabled NO CODE_SIGNING_ALLOWED=NO
-resultBundlePath "$RUNNER_TEMP/mac-session-navigation.xcresult"
-only-testing:HapiTests/SessionNavigationTests
- name: Mac split presentation regression tests
if: ${{ !cancelled() }}
timeout-minutes: 20
run: >-
xcodebuild test -project ios/Hapi.xcodeproj -scheme Hapi
-destination 'platform=macOS,variant=Mac Catalyst'
-enableCodeCoverage NO -parallel-testing-enabled NO CODE_SIGNING_ALLOWED=NO
-resultBundlePath "$RUNNER_TEMP/mac-session-split-presentation.xcresult"
-only-testing:HapiTests/SessionSplitPresentationTests
- name: Mac transcript geometry regression tests
if: ${{ !cancelled() }}
timeout-minutes: 20
run: >-
xcodebuild test -project ios/Hapi.xcodeproj -scheme Hapi
-destination 'platform=macOS,variant=Mac Catalyst'
-enableCodeCoverage NO -parallel-testing-enabled NO CODE_SIGNING_ALLOWED=NO
-resultBundlePath "$RUNNER_TEMP/mac-transcript-geometry.xcresult"
-only-testing:HapiTests/TranscriptGeometryTests
- name: Upload regression test results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: ios-regression-test-results
path: ${{ runner.temp }}/*.xcresult
if-no-files-found: ignore
retention-days: 7
- name: Verify localization catalog was not rewritten
run: git diff --exit-code -- ios/Hapi/Resources/Localizable.xcstrings