Skip to content

Commit f7ffe80

Browse files
committed
ci: update simulator action to v5 and improve Flutter test workflow
1 parent e9168b2 commit f7ffe80

File tree

9 files changed

+52
-20
lines changed

9 files changed

+52
-20
lines changed

.github/workflows/flutter_integration.yaml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v4
1313

14-
- uses: futureware-tech/simulator-action@v3
15-
with:
16-
model: ${{ matrix.device }}
17-
1814
- uses: subosito/flutter-action@v2
1915
with:
2016
flutter-version: '3.29'
@@ -24,11 +20,34 @@ jobs:
2420
# tests it's best to perform dependency update in both packages, to make sure that
2521
# integration tests are run with exactly the same dependencies as specified in
2622
# current version of ably_flutter package
27-
- name: 'Run Flutter Driver tests'
28-
timeout-minutes: 30
23+
- name: Update dependencies
2924
run: |
3025
flutter pub get
31-
cd test_integration && flutter drive
26+
cd test_integration && flutter pub get
27+
28+
- name: Build iOS app (no simulator needed yet)
29+
run: flutter build ios --simulator
30+
31+
- name: Pick simulator
32+
run: |
33+
DEVICE=$(xcrun simctl list devices available | \
34+
grep -E "iPhone" | head -n 1)
35+
echo $DEVICE
36+
UDID=$(echo $DEVICE | sed -E 's/.*\(([A-F0-9-]+)\).*/\1/')
37+
echo "SIMULATOR_ID=$UDID" >> $GITHUB_ENV
38+
39+
- name: Boot simulator
40+
timeout-minutes: 5
41+
run: |
42+
xcrun simctl boot "$SIMULATOR_ID" || true
43+
xcrun simctl bootstatus "$SIMULATOR_ID" -b
44+
45+
- name: Run integration tests (no rebuild)
46+
timeout-minutes: 25
47+
run: |
48+
flutter drive \
49+
--use-application-binary=build/ios/iphonesimulator/Runner.app \
50+
-d $SIMULATOR_ID
3251
3352
android:
3453
runs-on: ubuntu-latest

.github/workflows/ios_unit_tests.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v4
1313

14-
- uses: futureware-tech/simulator-action@v5
15-
id: ios-simulator
16-
1714
- uses: subosito/flutter-action@v2
1815
with:
1916
flutter-version: '3.29'
@@ -30,11 +27,19 @@ jobs:
3027
--validation-dir=/tmp/ably_test_build \
3128
--no-clean
3229
30+
- name: Pick simulator
31+
run: |
32+
UDID=$(xcrun simctl list devices available | \
33+
grep -E "iPhone" | head -n 1 | \
34+
sed -E 's/.*\(([A-F0-9-]+)\).*/\1/')
35+
echo "SIMULATOR_ID=$UDID" >> $GITHUB_ENV
36+
37+
3338
- name: Run iOS unit tests
3439
timeout-minutes: 30
3540
run: |
3641
xcodebuild test \
3742
-workspace /tmp/ably_test_build/App.xcworkspace \
3843
-scheme ably_flutter-Unit-Tests \
39-
-destination 'id=${{ steps.ios-simulator.outputs.udid }}' \
44+
-destination "id=$SIMULATOR_ID" \
4045
CODE_SIGNING_ALLOWED=NO

test_integration/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>9.0</string>
24+
<string>12.0</string>
2525
</dict>
2626
</plist>

test_integration/ios/Podfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Uncomment this line to define a global platform for your project
2-
platform :ios, '10.0'
3-
use_frameworks!
2+
platform :ios, '12.0'
43

54
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
65
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@@ -29,7 +28,8 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe
2928
flutter_ios_podfile_setup
3029

3130
target 'Runner' do
32-
31+
use_frameworks!
32+
use_modular_headers!
3333

3434
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
3535
end

test_integration/ios/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ SPEC CHECKSUMS:
3232
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
3333
msgpack: c85f6251873059738472ae136951cec5f30f3251
3434

35-
PODFILE CHECKSUM: f2c6cc511583caab2c65ac3f5766428391d93d34
35+
PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048
3636

3737
COCOAPODS: 1.16.2

test_integration/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 51;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -155,7 +155,7 @@
155155
97C146E61CF9000F007C117D /* Project object */ = {
156156
isa = PBXProject;
157157
attributes = {
158-
LastUpgradeCheck = 1300;
158+
LastUpgradeCheck = 1510;
159159
ORGANIZATIONNAME = "";
160160
TargetAttributes = {
161161
97C146ED1CF9000F007C117D = {
@@ -199,10 +199,12 @@
199199
/* Begin PBXShellScriptBuildPhase section */
200200
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
201201
isa = PBXShellScriptBuildPhase;
202+
alwaysOutOfDate = 1;
202203
buildActionMask = 2147483647;
203204
files = (
204205
);
205206
inputPaths = (
207+
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
206208
);
207209
name = "Thin Binary";
208210
outputPaths = (
@@ -213,6 +215,7 @@
213215
};
214216
9740EEB61CF901F6004384FC /* Run Script */ = {
215217
isa = PBXShellScriptBuildPhase;
218+
alwaysOutOfDate = 1;
216219
buildActionMask = 2147483647;
217220
files = (
218221
);

test_integration/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1300"
3+
LastUpgradeVersion = "1510"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -50,6 +50,7 @@
5050
ignoresPersistentStateOnLaunch = "NO"
5151
debugDocumentVersioning = "YES"
5252
debugServiceExtension = "internal"
53+
enableGPUValidationMode = "1"
5354
allowLocationSimulation = "YES">
5455
<BuildableProductRunnable
5556
runnableDebuggingMode = "0">

test_integration/ios/Runner/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import UIKit
22
import Flutter
33

4-
@UIApplicationMain
4+
@main
55
@objc class AppDelegate: FlutterAppDelegate {
66
override func application(
77
_ application: UIApplication,

test_integration/ios/Runner/Info.plist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,9 @@
4141
</array>
4242
<key>UIViewControllerBasedStatusBarAppearance</key>
4343
<false/>
44+
<key>CADisableMinimumFrameDurationOnPhone</key>
45+
<true/>
46+
<key>UIApplicationSupportsIndirectInputEvents</key>
47+
<true/>
4448
</dict>
4549
</plist>

0 commit comments

Comments
 (0)