diff --git a/.github/workflows/flutter_integration.yaml b/.github/workflows/flutter_integration.yaml index db1fde8d8..2d0fe98ba 100644 --- a/.github/workflows/flutter_integration.yaml +++ b/.github/workflows/flutter_integration.yaml @@ -11,10 +11,6 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: futureware-tech/simulator-action@v3 - with: - model: ${{ matrix.device }} - - uses: subosito/flutter-action@v2 with: flutter-version: '3.29' @@ -24,11 +20,36 @@ jobs: # tests it's best to perform dependency update in both packages, to make sure that # integration tests are run with exactly the same dependencies as specified in # current version of ably_flutter package - - name: 'Run Flutter Driver tests' - timeout-minutes: 30 + - name: Update dependencies run: | flutter pub get - cd test_integration && flutter drive + cd test_integration && flutter pub get + + - name: Build iOS app (no simulator needed yet) + working-directory: test_integration + run: flutter build ios --simulator + + - name: Pick simulator + run: | + DEVICE=$(xcrun simctl list devices available | \ + grep -E "iPhone" | head -n 1) + echo $DEVICE + UDID=$(echo $DEVICE | sed -E 's/.*\(([A-F0-9-]+)\).*/\1/') + echo "SIMULATOR_ID=$UDID" >> $GITHUB_ENV + + - name: Boot simulator + timeout-minutes: 5 + run: | + xcrun simctl boot "$SIMULATOR_ID" || true + xcrun simctl bootstatus "$SIMULATOR_ID" -b + + - name: Run integration tests (no rebuild) + timeout-minutes: 25 + working-directory: test_integration + run: | + flutter drive --no-pub --no-build \ + --use-application-binary=build/ios/iphonesimulator/Runner.app \ + -d $SIMULATOR_ID android: runs-on: ubuntu-latest diff --git a/.github/workflows/ios_unit_tests.yml b/.github/workflows/ios_unit_tests.yml index 9d7e3f26b..d90477812 100644 --- a/.github/workflows/ios_unit_tests.yml +++ b/.github/workflows/ios_unit_tests.yml @@ -11,9 +11,6 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: futureware-tech/simulator-action@v5 - id: ios-simulator - - uses: subosito/flutter-action@v2 with: flutter-version: '3.29' @@ -30,11 +27,19 @@ jobs: --validation-dir=/tmp/ably_test_build \ --no-clean + - name: Pick simulator + run: | + UDID=$(xcrun simctl list devices available | \ + grep -E "iPhone" | head -n 1 | \ + sed -E 's/.*\(([A-F0-9-]+)\).*/\1/') + echo "SIMULATOR_ID=$UDID" >> $GITHUB_ENV + + - name: Run iOS unit tests timeout-minutes: 30 run: | xcodebuild test \ -workspace /tmp/ably_test_build/App.xcworkspace \ -scheme ably_flutter-Unit-Tests \ - -destination 'id=${{ steps.ios-simulator.outputs.udid }}' \ + -destination "id=$SIMULATOR_ID,arch=arm64" \ CODE_SIGNING_ALLOWED=NO diff --git a/test_integration/ios/Flutter/AppFrameworkInfo.plist b/test_integration/ios/Flutter/AppFrameworkInfo.plist index f2872cf47..8c6e56146 100644 --- a/test_integration/ios/Flutter/AppFrameworkInfo.plist +++ b/test_integration/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 9.0 + 12.0 diff --git a/test_integration/ios/Podfile b/test_integration/ios/Podfile index 7262024c7..2c068c404 100644 --- a/test_integration/ios/Podfile +++ b/test_integration/ios/Podfile @@ -1,6 +1,5 @@ # Uncomment this line to define a global platform for your project -platform :ios, '10.0' -use_frameworks! +platform :ios, '12.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' @@ -29,7 +28,8 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe flutter_ios_podfile_setup target 'Runner' do - + use_frameworks! + use_modular_headers! flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end diff --git a/test_integration/ios/Podfile.lock b/test_integration/ios/Podfile.lock index 16f225368..9b1ef0c69 100644 --- a/test_integration/ios/Podfile.lock +++ b/test_integration/ios/Podfile.lock @@ -32,6 +32,6 @@ SPEC CHECKSUMS: Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 msgpack: c85f6251873059738472ae136951cec5f30f3251 -PODFILE CHECKSUM: f2c6cc511583caab2c65ac3f5766428391d93d34 +PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048 COCOAPODS: 1.16.2 diff --git a/test_integration/ios/Runner.xcodeproj/project.pbxproj b/test_integration/ios/Runner.xcodeproj/project.pbxproj index bba3abfb1..b2609ce9a 100644 --- a/test_integration/ios/Runner.xcodeproj/project.pbxproj +++ b/test_integration/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -155,7 +155,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -199,10 +199,12 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -213,6 +215,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); diff --git a/test_integration/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/test_integration/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 3db53b6e1..4f746537f 100644 --- a/test_integration/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/test_integration/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ diff --git a/test_integration/ios/Runner/AppDelegate.swift b/test_integration/ios/Runner/AppDelegate.swift index 70693e4a8..b63630348 100644 --- a/test_integration/ios/Runner/AppDelegate.swift +++ b/test_integration/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/test_integration/ios/Runner/Info.plist b/test_integration/ios/Runner/Info.plist index 24fa028c8..7841a3952 100644 --- a/test_integration/ios/Runner/Info.plist +++ b/test_integration/ios/Runner/Info.plist @@ -41,5 +41,9 @@ UIViewControllerBasedStatusBarAppearance + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents +