Skip to content

Commit e52399d

Browse files
authored
ci: update iOS workflow to use macOS 14 runner (#1064)
* Update iOS CI workflow to use macOS 14 runner * Add `--break-system-packages` flag and remove redundant pip upgrade in iOS CI post-clone script. * Set up iPhone 16 Pro simulator in iOS CI workflow * Fix defaults command in iOS CI simulator setup script to correctly set `CurrentDeviceUDID` and add fallback warning * Improve backend description layout in BenchmarkConfigSection to support text overflow handling
1 parent 0e726d8 commit e52399d

File tree

4 files changed

+56
-6
lines changed

4 files changed

+56
-6
lines changed

.github/workflows/ios-build-test.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ on:
99
jobs:
1010
build:
1111
name: Build and test iOS app
12-
# https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md
13-
runs-on: macos-13
12+
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
13+
runs-on: macos-14
1414
timeout-minutes: 180
1515
env:
1616
PERF_TEST: true
@@ -62,11 +62,17 @@ jobs:
6262
- name: Build iOS integration tests
6363
run: |
6464
cd flutter && flutter --no-version-check build ios --simulator integration_test/first_test.dart
65+
- name: Setup iOS simulator
66+
env:
67+
DEVICE_NAME: "iPhone 16 Pro"
68+
RUNTIME_SDK: "iphonesimulator18.2"
69+
run: |
70+
cd flutter/ios/ci_scripts/ && bash setup_simulator.sh
71+
open -a Simulator
6572
- uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
6673
name: Run iOS integration tests
6774
with:
6875
timeout_minutes: 120
6976
max_attempts: 2
7077
command: |
71-
open -a Simulator
7278
make flutter/test/integration

flutter/ios/ci_scripts/ci_post_clone.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ brew install cocoapods || brew install cocoapods || brew install cocoapods
6565
echo "$MC_LOG_PREFIX cocoapods version:" && pod --version
6666

6767
echo "$MC_LOG_PREFIX python version:" && python3 --version
68-
python3 -m pip install --upgrade pip
69-
python3 -m pip install \
68+
python3 -m pip install --break-system-packages \
7069
"numpy>=1.23,<2.0" \
7170
"absl-py>=1.3,<2.0"
7271

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
set -euo pipefail
2+
3+
# DEVICE_NAME="iPhone 16 Pro"
4+
# RUNTIME_SDK="iphonesimulator18.1"
5+
# Allow overriding device type by ID; fallback to name for display purposes
6+
DEVICE_TYPE_ID="${DEVICE_TYPE_ID:-}"
7+
DEVICE_NAME="${DEVICE_NAME:-${DEVICE_TYPE_ID:-iPhone 16 Pro}}"
8+
9+
# Build the runtime ID (must use SimRuntime namespace)
10+
RUNTIME_ID="com.apple.CoreSimulator.SimRuntime.iOS-$(echo "$RUNTIME_SDK" | sed -E 's/[^0-9]*([0-9]+)\.([0-9]+).*/\1-\2/')"
11+
12+
# Validate that the requested device type exists
13+
if [ -n "${DEVICE_TYPE_ID}" ]; then
14+
xcrun simctl list devicetypes | grep -q "(${DEVICE_TYPE_ID})" || { echo "Device type ID '${DEVICE_TYPE_ID}' not found"; exit 1; }
15+
else
16+
xcrun simctl list devicetypes | grep -q "^${DEVICE_NAME} " || { echo "Device type '${DEVICE_NAME}' not found"; exit 1; }
17+
fi
18+
19+
# Validate that the requested runtime exists
20+
xcrun simctl list runtimes | grep -q "${RUNTIME_ID}" || { echo "Runtime '${RUNTIME_ID}' not installed on this runner"; exit 1; }
21+
22+
# Try to locate an existing device of the given type and runtime, otherwise create it
23+
UDID=$(xcrun simctl list devices "${RUNTIME_ID}" | awk -v dev="${DEVICE_NAME}" -F'[()]' '
24+
$0 ~ dev {
25+
cand=$(NF-1)
26+
gsub(/^[[:space:]]+|[[:space:]]+$/, "", cand)
27+
if (cand ~ /^[0-9A-Fa-f-]{36}$/) { print cand; exit }
28+
}')
29+
if [ -z "${UDID:-}" ]; then
30+
TYPE_ARG="${DEVICE_TYPE_ID:-${DEVICE_NAME}}"
31+
UDID=$(xcrun simctl create "CI ${DEVICE_NAME}" "${TYPE_ARG}" "${RUNTIME_ID}")
32+
echo "Created ${DEVICE_NAME}: ${UDID}"
33+
else
34+
echo "Reusing ${DEVICE_NAME}: ${UDID}"
35+
fi
36+
37+
xcrun simctl boot "${UDID}" || true
38+
xcrun simctl bootstatus "${UDID}" -b
39+
40+
defaults write com.apple.iphonesimulator CurrentDeviceUDID -string "${UDID}" || echo "Warning: failed to set CurrentDeviceUDID via defaults (non-fatal)"

flutter/lib/ui/home/benchmark_config_section.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ class BenchmarkConfigSection extends StatelessWidget {
8484
const SizedBox(height: 10),
8585
Row(
8686
children: [
87-
_backendDescription(benchmark, context),
87+
Flexible(
88+
child: _backendDescription(benchmark, context),
89+
),
8890
const SizedBox(
8991
height: 18,
9092
child: VerticalDivider(
@@ -131,6 +133,9 @@ class BenchmarkConfigSection extends StatelessWidget {
131133
return Text(
132134
benchmark.backendRequestDescription,
133135
style: Theme.of(context).textTheme.labelLarge,
136+
maxLines: 1,
137+
overflow: TextOverflow.ellipsis,
138+
softWrap: false,
134139
);
135140
}
136141

0 commit comments

Comments
 (0)