Skip to content

Commit

Permalink
[ci] Initial migration to Cirrus Apple silicon
Browse files Browse the repository at this point in the history
This adopts the new Apple silicon images for:
- linting
- macOS platform tests
- iOS build-all

This gives us build coverage across both architectures for both iOS and
macOS.

Ideally we would use ARM for iOS platform tests instead of build-all,
but driving the iOS tests currently has flaky hangs on ARM. See
flutter#5693 for details. Completing
that part of the migration is left as a TODO.
  • Loading branch information
stuartmorgan committed May 20, 2022
1 parent f4ca732 commit cd53491
Showing 1 changed file with 39 additions and 19 deletions.
58 changes: 39 additions & 19 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,17 @@ macos_template: &MACOS_TEMPLATE
# Only one macOS task can run in parallel without credits, so use them for
# PRs on macOS.
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'

macos_intel_template: &MACOS_INTEL_TEMPLATE
<< : *MACOS_TEMPLATE
osx_instance:
image: big-sur-xcode-13

macos_arm_template: &MACOS_ARM_TEMPLATE
<< : *MACOS_TEMPLATE
macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-xcode:13.4

# Light-workload Linux tasks.
# These use default machines, with fewer CPUs, to reduce pressure on the
# concurrency limits.
Expand Down Expand Up @@ -298,7 +306,7 @@ task:
drive_script:
- ./script/tool_runner.sh drive-examples --web --exclude=script/configs/exclude_integration_web.yaml

# macOS tasks.
# ARM macOS tasks.
task:
<< : *MACOS_TEMPLATE
<< : *FLUTTER_UPGRADE_TEMPLATE
Expand All @@ -315,6 +323,34 @@ task:
CHANNEL: "master"
CHANNEL: "stable"
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE
### macOS desktop tasks ###
- name: macos-platform_tests
env:
matrix:
CHANNEL: "master"
CHANNEL: "stable"
PATH: $PATH:/usr/local/bin
build_script:
- flutter config --enable-macos-desktop
- ./script/tool_runner.sh build-examples --macos
xcode_analyze_script:
- ./script/tool_runner.sh xcode-analyze --macos
xcode_analyze_deprecation_script:
# Ensure we don't accidentally introduce deprecated code.
- ./script/tool_runner.sh xcode-analyze --macos --macos-min-version=12.3
native_test_script:
- ./script/tool_runner.sh native-test --macos
drive_script:
- ./script/tool_runner.sh drive-examples --macos --exclude=script/configs/exclude_integration_macos.yaml

# Intel macOS tasks.
task:
<< : *MACOS_INTEL_TEMPLATE
<< : *FLUTTER_UPGRADE_TEMPLATE
matrix:
# TODO(stuartmorgan): Swap this and ios-build_all_plugins once simulator
# tests are reliable on the ARM infrastructure. See discussion at
# https:/flutter/plugins/pull/5693#issuecomment-1126011089
- name: ios-platform_tests
env:
PATH: $PATH:/usr/local/bin
Expand Down Expand Up @@ -345,6 +381,8 @@ task:
# So we run `drive-examples` after `native-test`; changing the order will result ci failure.
- ./script/tool_runner.sh drive-examples --ios --exclude=script/configs/exclude_integration_ios.yaml
### macOS desktop tasks ###
# macos-platform_tests builds all the plugins on M1, so this build is run
# on Intel to give us build coverage of both host types.
- name: macos-build_all_plugins
env:
BUILD_ALL_ARGS: "macos"
Expand All @@ -354,21 +392,3 @@ task:
setup_script:
- flutter config --enable-macos-desktop
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE
- name: macos-platform_tests
env:
matrix:
CHANNEL: "master"
CHANNEL: "stable"
PATH: $PATH:/usr/local/bin
build_script:
- flutter config --enable-macos-desktop
- ./script/tool_runner.sh build-examples --macos
xcode_analyze_script:
- ./script/tool_runner.sh xcode-analyze --macos
xcode_analyze_deprecation_script:
# Ensure we don't accidentally introduce deprecated code.
- ./script/tool_runner.sh xcode-analyze --macos --macos-min-version=12.3
native_test_script:
- ./script/tool_runner.sh native-test --macos
drive_script:
- ./script/tool_runner.sh drive-examples --macos --exclude=script/configs/exclude_integration_macos.yaml

0 comments on commit cd53491

Please sign in to comment.