Switch to Xcode 15 (with the iOS 16.4 Simulator for tests still) (#2113)
* Use Xcode 15 in GitHub actions. Use iOS 16.4 simulators from Xcode 14 as iOS 17.0.1 simulators are **super** slow. * Fix failing preview snapshots. Snapshot fix. * Improve setup * Regenerate snapshots that had a conflict. --------- Co-authored-by: Alfonso Grillo <alfogrillo@gmail.com>
This commit is contained in:
@@ -3,7 +3,7 @@ require 'semantic'
|
||||
require_relative 'changelog'
|
||||
|
||||
before_all do
|
||||
xcversion(version: "~> 14.3")
|
||||
xcversion(version: "~> 15.0")
|
||||
|
||||
ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "180"
|
||||
ENV["FASTLANE_XCODE_LIST_TIMEOUT"] = "180"
|
||||
@@ -76,6 +76,12 @@ lane :alpha do
|
||||
end
|
||||
|
||||
lane :unit_tests do
|
||||
create_simulator_if_necessary(
|
||||
name: "iPhone 14 (16.4)",
|
||||
type: "com.apple.CoreSimulator.SimDeviceType.iPhone-14",
|
||||
runtime: "com.apple.CoreSimulator.SimRuntime.iOS-16-4"
|
||||
)
|
||||
|
||||
run_tests(
|
||||
scheme: "UnitTests",
|
||||
device: 'iPhone 14 (16.4)',
|
||||
@@ -97,9 +103,16 @@ lane :ui_tests do |options|
|
||||
# Use a fresh simulator state to ensure hardware keyboard isn't attached.
|
||||
reset_simulator_contents()
|
||||
|
||||
create_simulator_if_necessary(
|
||||
name: "iPhone 14 (16.4)",
|
||||
type: "com.apple.CoreSimulator.SimDeviceType.iPhone-14",
|
||||
runtime: "com.apple.CoreSimulator.SimRuntime.iOS-16-4"
|
||||
)
|
||||
|
||||
create_simulator_if_necessary(
|
||||
name: "iPad (9th generation)",
|
||||
type: "com.apple.CoreSimulator.SimDeviceType.iPad-9th-generation"
|
||||
type: "com.apple.CoreSimulator.SimDeviceType.iPad-9th-generation",
|
||||
runtime: "com.apple.CoreSimulator.SimRuntime.iOS-16-4"
|
||||
)
|
||||
|
||||
if options[:test_name]
|
||||
@@ -141,7 +154,8 @@ lane :integration_tests do
|
||||
|
||||
create_simulator_if_necessary(
|
||||
name: "iPhone 14 Pro",
|
||||
type: "com.apple.CoreSimulator.SimDeviceType.iPhone-14-Pro"
|
||||
type: "com.apple.CoreSimulator.SimDeviceType.iPhone-14-Pro",
|
||||
runtime: "com.apple.CoreSimulator.SimRuntime.iOS-16-4"
|
||||
)
|
||||
|
||||
run_tests(
|
||||
@@ -411,13 +425,16 @@ private_lane :create_simulator_if_necessary do |options|
|
||||
|
||||
simulator_type = options[:type]
|
||||
UI.user_error!("Invalid simulator type") unless !simulator_type.to_s.empty?
|
||||
|
||||
simulator_runtime = options[:runtime]
|
||||
UI.user_error!("Invalid simulator runtime") unless !simulator_runtime.to_s.empty?
|
||||
|
||||
|
||||
# Use use a `(` here to avoid matching `iPhone 14 Pro` on `iPhone 14 Pro Max` for example
|
||||
# Use a `(` here to avoid matching `iPhone 14 Pro` on `iPhone 14 Pro Max` for example
|
||||
begin sh("xcrun simctl list devices | grep '#{simulator_name} ('")
|
||||
UI.success "Simulator already exists"
|
||||
rescue
|
||||
sh("xcrun simctl create '#{simulator_name}' #{simulator_type}")
|
||||
sh("xcrun simctl create '#{simulator_name}' #{simulator_type} #{simulator_runtime}")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user