Feat: Session Replay GA #627
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: UI Tests Critical | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
paths: | |
- 'Sources/**' | |
- '.github/workflows/ui-tests-critical.yml' | |
- 'fastlane/**' | |
- 'TestSamples/**' | |
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
build-sample: | |
name: Build SwiftUITestSample Sample | |
runs-on: macos-15 | |
steps: | |
- uses: actions/checkout@v4 | |
- run: ./scripts/ci-select-xcode.sh "16.0" | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- run: bundle exec fastlane build_ios_swift_ui_test_sample | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: SwiftUITestSample | |
path: TestSamples/SwiftUITestSample/DerivedData/Build/Products/Debug-iphonesimulator/SwiftUITestSample.app | |
run-tests: | |
name: Test iOS ${{matrix.os-version}} on ${{matrix.device}} Simulator | |
needs: [build-sample] | |
runs-on: ${{matrix.runs-on}} | |
env: | |
APP_ARTIFACT_NAME: "SwiftUITestSample" | |
APP_PATH: "Sample.app" | |
MAESTRO_FLOWS_PATH: "TestSamples/SwiftUITestSample/Maestro" | |
MAESTRO_LOGS_PATH: "MaestroLogs" | |
# https://github.com/facebook/react-native/blob/24e7f7d25629a7af6d877a0b79fed2faaab96437/.github/actions/maestro-ios/action.yml#L57 | |
MAESTRO_DRIVER_STARTUP_TIMEOUT: 1500000 # 25 min, CI can be slow at times | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- runs-on: macos-13 | |
xcode: "14.3.1" | |
device: "iPhone 14" | |
os-version: "16.4" | |
force-sim-runtime: true | |
# macos-14 iOS 17 not included due to the XCUIServerNotFound errors causing flaky tests | |
- runs-on: macos-15 | |
xcode: "16" | |
device: "iPhone 16" | |
os-version: "18.0" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create ${{matrix.device}} (${{matrix.os-version}}) Simulator using Xcode ${{matrix.xcode}} | |
run: ./scripts/create-simulator.sh "${{matrix.xcode}}" "${{matrix.os-version}}" "${{matrix.device}}" "${{matrix.force-sim-runtime}}" | |
- name: Install Maestro | |
run: brew tap mobile-dev-inc/tap && brew install mobile-dev-inc/tap/[email protected] | |
- name: Install iDB Companion | |
run: brew tap facebook/fb && brew install facebook/fb/idb-companion | |
- uses: actions/download-artifact@v4 | |
with: | |
name: ${{env.APP_ARTIFACT_NAME}} | |
path: ${{env.APP_PATH}} | |
- name: Run Maestro Flows | |
run: | | |
xcrun simctl install booted ${{env.APP_PATH}} | |
maestro test ${{env.MAESTRO_FLOWS_PATH}} --format junit --debug-output ${{env.MAESTRO_LOGS_PATH}} | |
- name: Delete Simulator | |
if: always() | |
run: ./scripts/delete-simulator.sh | |
- name: Store Maestro Logs | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: maestro-logs-${{matrix.device}}-${{matrix.os-version}} | |
path: ${{env.MAESTRO_LOGS_PATH}} |