Skip to content

Commit

Permalink
Manually create requested simulators
Browse files Browse the repository at this point in the history
  • Loading branch information
krystofwoldrich committed Oct 7, 2024
1 parent 6933495 commit 7033e0a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/eval-maestro-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,25 @@ jobs:
artifact-name: maestro-ios-objc
app: "Sample.app"
test_suit: "Samples/iOS-ObjectiveC/.maestro"
runs-on: macos-13
runs-on: macos-14
xcode: "14.3.1"
device: "iPhone 14"
os-version: "16.1"
os-version: "16.4"

- sample-name: iOS-SwiftUI
artifact-name: maestro-ios-swift-ui
app: "Sample.app"
test_suit: "Samples/iOS-SwiftUI/.maestro"
runs-on: macos-12
xcode: "13.4.1"
device: "iPhone 8"
os-version: "15.2"
os-version: "15.5"
- sample-name: iOS-SwiftUI
artifact-name: maestro-ios-swift-ui
app: "Sample.app"
test_suit: "Samples/iOS-SwiftUI/.maestro"
runs-on: macos-14
xcode: "14.3.1"
device: "iPhone 14"
os-version: "16.4"

Expand All @@ -89,29 +92,35 @@ jobs:
app: "Sample.app"
test_suit: "Samples/iOS-Swift/.maestro"
runs-on: macos-12
xcode: "13.4.1"
device: "iPhone 8"
os-version: "15.5"
- sample-name: iOS-Swift
artifact-name: maestro-ios-swift
app: "Sample.app"
test_suit: "Samples/iOS-Swift/.maestro"
runs-on: macos-13
xcode: "14.3.1"
device: "iPhone 14"
os-version: "16.4"
- sample-name: iOS-Swift
artifact-name: maestro-ios-swift
app: "Sample.app"
test_suit: "Samples/iOS-Swift/.maestro"
runs-on: macos-14
xcode: "15.4"
device: "iPhone 15"
os-version: "17.2"
os-version: "17.5"

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}}"
- name: Install Maestro
run: brew tap mobile-dev-inc/tap && brew install mobile-dev-inc/tap/maestro@1.38
- name: Install iDB Companion
run: brew tap facebook/fb && brew install facebook/fb/idb-companion

- uses: actions/download-artifact@v4
with:
name: ${{matrix.artifact-name}}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:

- name: Create iOS 16.4 simulator
if: ${{ matrix.device == 'iPhone 14 (16.4)' }}
run: ./scripts/create-simulator.sh 14.3.1 16.4 16-4
run: ./scripts/create-simulator.sh 14.3.1 16.4 "iPhone 14"

- name: Run Fastlane
run: fastlane ui_tests_ios_swift device:"${{matrix.device}}"
Expand Down
6 changes: 4 additions & 2 deletions scripts/create-simulator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ set -euo pipefail

XCODE_VERSION="${1}"
SIM_RUNTIME="${2}"
SIM_RUNTIME_WITH_DASH="${3}"
DEVICE_TYPE="${3}" # A valid available device type. Find these by running "xcrun simctl list devicetypes".

SIM_RUNTIME_WITH_DASH="${SIM_RUNTIME//./-}"

sudo mkdir -p /Library/Developer/CoreSimulator/Profiles/Runtimes
sudo ln -s "/Applications/Xcode_${XCODE_VERSION}.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime" "/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS ${SIM_RUNTIME}.simruntime"
xcrun simctl create custom-test-device "iPhone 8" "com.apple.CoreSimulator.SimRuntime.iOS-${SIM_RUNTIME_WITH_DASH}"
xcrun simctl create custom-test-device "${DEVICE_TYPE}" "com.apple.CoreSimulator.SimRuntime.iOS-${SIM_RUNTIME_WITH_DASH}"

0 comments on commit 7033e0a

Please sign in to comment.