diff --git a/.ci.yaml b/.ci.yaml index e48175acc6a2..dffc7364e65a 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -75,6 +75,99 @@ targets: target_file: mac_build_all_plugins.yaml channel: stable + ### iOS tasks ### + # TODO(stuartmorgan): Swap this and ios-build_all_plugins once simulator + # tests are reliable on the ARM infrastructure. See discussion at + # https://github.com/flutter/plugins/pull/5693#issuecomment-1126011089 + - name: Mac_x64 ios_platform_tests_1_of_4 master + recipe: plugins/plugins + bringup: true # New target: https://github.com/flutter/plugins/pull/6682 + timeout: 30 + properties: + add_recipes_cq: "true" + version_file: flutter_master.version + target_file: mac_ios_platform_tests.yaml + package_sharding: "--shardIndex 0 --shardCount 4" + + - name: Mac_x64 ios_platform_tests_2_of_4 master + recipe: plugins/plugins + bringup: true # New target: https://github.com/flutter/plugins/pull/6682 + timeout: 30 + properties: + add_recipes_cq: "true" + version_file: flutter_master.version + target_file: mac_ios_platform_tests.yaml + package_sharding: "--shardIndex 1 --shardCount 4" + + - name: Mac_x64 ios_platform_tests_3_of_4 master + recipe: plugins/plugins + bringup: true # New target: https://github.com/flutter/plugins/pull/6682 + timeout: 30 + properties: + add_recipes_cq: "true" + version_file: flutter_master.version + target_file: mac_ios_platform_tests.yaml + package_sharding: "--shardIndex 2 --shardCount 4" + + - name: Mac_x64 ios_platform_tests_4_of_4 master + recipe: plugins/plugins + bringup: true # New target: https://github.com/flutter/plugins/pull/6682 + timeout: 30 + properties: + add_recipes_cq: "true" + version_file: flutter_master.version + target_file: mac_ios_platform_tests.yaml + package_sharding: "--shardIndex 3 --shardCount 4" + + # Don't run full platform tests on both channels in pre-submit. + - name: Mac_x64 ios_platform_tests_1_of_4 stable + recipe: plugins/plugins + presubmit: false + bringup: true # New target: https://github.com/flutter/plugins/pull/6682 + timeout: 30 + properties: + channel: stable + add_recipes_cq: "true" + version_file: flutter_stable.version + target_file: mac_ios_platform_tests.yaml + package_sharding: "--shardIndex 0 --shardCount 4" + + - name: Mac_x64 ios_platform_tests_2_of_4 stable + recipe: plugins/plugins + presubmit: false + bringup: true # New target: https://github.com/flutter/plugins/pull/6682 + timeout: 30 + properties: + channel: stable + add_recipes_cq: "true" + version_file: flutter_stable.version + target_file: mac_ios_platform_tests.yaml + package_sharding: "--shardIndex 1 --shardCount 4" + + - name: Mac_x64 ios_platform_tests_3_of_4 stable + recipe: plugins/plugins + presubmit: false + bringup: true # New target: https://github.com/flutter/plugins/pull/6682 + timeout: 30 + properties: + channel: stable + add_recipes_cq: "true" + version_file: flutter_stable.version + target_file: mac_ios_platform_tests.yaml + package_sharding: "--shardIndex 2 --shardCount 4" + + - name: Mac_x64 ios_platform_tests_4_of_4 stable + recipe: plugins/plugins + presubmit: false + bringup: true # New target: https://github.com/flutter/plugins/pull/6682 + timeout: 30 + properties: + channel: stable + add_recipes_cq: "true" + version_file: flutter_stable.version + target_file: mac_ios_platform_tests.yaml + package_sharding: "--shardIndex 3 --shardCount 4" + - name: Windows win32-platform_tests master recipe: plugins/plugins timeout: 30 diff --git a/.ci/scripts/create_simulator.sh b/.ci/scripts/create_simulator.sh new file mode 100644 index 000000000000..3d86739051f1 --- /dev/null +++ b/.ci/scripts/create_simulator.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# Copyright 2013 The Flutter Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +device=com.apple.CoreSimulator.SimDeviceType.iPhone-11 +os=com.apple.CoreSimulator.SimRuntime.iOS-16-0 + +xcrun simctl list +xcrun simctl create Flutter-iPhone "$device" "$os" | xargs xcrun simctl boot diff --git a/.ci/targets/mac_ios_platform_tests.yaml b/.ci/targets/mac_ios_platform_tests.yaml new file mode 100644 index 000000000000..ed63f226eaec --- /dev/null +++ b/.ci/targets/mac_ios_platform_tests.yaml @@ -0,0 +1,22 @@ +tasks: + - name: create simulator + script: .ci/scripts/create_simulator.sh + - name: build examples + script: script/tool_runner.sh + args: ["build-examples", "--ios"] + - name: xcode analyze + script: script/tool_runner.sh + args: ["xcode-analyze", "--ios"] + - name: xcode analyze deprecation + # Ensure we don't accidentally introduce deprecated code. + script: script/tool_runner.sh + args: ["xcode-analyze", "--ios", "--ios-min-version=13.0"] + - name: native test + script: script/tool_runner.sh + args: ["native-test", "--ios", "--ios-destination", "platform=iOS Simulator,name=iPhone 11,OS=latest"] + - name: drive examples + # `drive-examples` contains integration tests, which changes the UI of the application. + # This UI change sometimes affects `xctest`. + # So we run `drive-examples` after `native-test`; changing the order will result ci failure. + script: script/tool_runner.sh + args: ["drive-examples", "--ios", "--exclude=script/configs/exclude_integration_ios.yaml"]