From f9817345f7a48d168df67c603a1928dd7df7332d Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Wed, 10 Mar 2021 14:58:59 -0800 Subject: [PATCH 1/3] Skip flutter upgrade for pod linting Cirrus task --- .cirrus.yml | 67 ++++++++++++++++++++++++++++------------------------- 1 file changed, 36 insertions(+), 31 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 8f61fabc4f2a..ccb3b225dc4a 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,25 +1,35 @@ -root_task_template: &ROOT_TASK_TEMPLATE - # Don't run on release tags since it creates O(n^2) tasks where n is the - # number of plugins - only_if: $CIRRUS_TAG == '' - use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_PR == '' +flutter_upgrade_template: &FLUTTER_UPGRADE_TEMPLATE env: - INTEGRATION_TEST_PATH: "./packages/integration_test" CHANNEL: "master" # Default to master when not explicitly set by a task. - PLUGIN_TOOLS: "dart run ./script/tool/lib/src/main.dart" - setup_script: + upgrade_flutter_script: - flutter channel $CHANNEL - flutter upgrade - - git fetch origin master # To set FETCH_HEAD for "git merge-base" to work - - cd script/tool - - pub get +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' + osx_instance: + image: big-sur-xcode-12.3 + cocoapod_install_script: sudo gem install cocoapods + +# Don't run on release tags since it creates O(n^2) tasks where n is the +# number of plugins +only_if: $CIRRUS_TAG == '' +use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_PR == '' +env: + INTEGRATION_TEST_PATH: "./packages/integration_test" + PLUGIN_TOOLS: "dart run ./script/tool/lib/src/main.dart" +setup_tool_script: + - git fetch origin master # To set FETCH_HEAD for "git merge-base" to work + - cd script/tool + - pub get # Light-workload Linux tasks. # These use default machines, with fewer CPUs, to reduce pressure on the # concurrency limits. task: - << : *ROOT_TASK_TEMPLATE + << : *FLUTTER_UPGRADE_TEMPLATE container: dockerfile: .ci/Dockerfile matrix: @@ -109,7 +119,7 @@ task: # tasks" block above once web_installers has been updated to support Chrome 89 # (which is what the current image generated from .ci/Dockerfile has). task: - << : *ROOT_TASK_TEMPLATE + << : *FLUTTER_UPGRADE_TEMPLATE container: dockerfile: .ci/Dockerfile-LegacyChrome matrix: @@ -134,7 +144,7 @@ task: # These use machines with more CPUs and memory, so will reduce parallelization # for non-credit runs. task: - << : *ROOT_TASK_TEMPLATE + << : *FLUTTER_UPGRADE_TEMPLATE container: dockerfile: .ci/Dockerfile cpu: 4 @@ -177,24 +187,9 @@ task: # macOS tasks. task: - << : *ROOT_TASK_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' - osx_instance: - image: big-sur-xcode-12.3 - cocoapod_install_script: sudo gem install cocoapods + << : *FLUTTER_UPGRADE_TEMPLATE + << : *MACOS_TEMPLATE matrix: - ### Platform-agnostic tasks ### - - name: lint_darwin_plugins - env: - matrix: - PLUGIN_SHARDING: "--shardIndex 0 --shardCount 2" - PLUGIN_SHARDING: "--shardIndex 1 --shardCount 2" - script: - # TODO(jmagman): Lint macOS podspecs but skip any that fail library validation. - - find . -name "*.podspec" | xargs grep -l "osx" | xargs rm - - ./script/incremental_build.sh podspecs ### iOS tasks ### - name: build_all_plugins_ipa env: @@ -245,3 +240,13 @@ task: - flutter config --enable-macos-desktop - ./script/incremental_build.sh build-examples --macos --no-ipa - ./script/incremental_build.sh drive-examples --macos + +task: + # Don't used FLUTTER_UPGRADE_TEMPLATE, Flutter tooling not needed. + << : *MACOS_TEMPLATE + matrix: + - name: lint_darwin_plugins + script: + # TODO(jmagman): Lint macOS podspecs but skip any that fail library validation. + - find . -name "*.podspec" | xargs grep -l "osx" | xargs rm + - ./script/incremental_build.sh podspecs From 710971cd0b4baa01702b03332656de318d76d5ce Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Wed, 10 Mar 2021 15:14:53 -0800 Subject: [PATCH 2/3] Setup tool template --- .cirrus.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index ccb3b225dc4a..8d11f9571e9f 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,9 +1,14 @@ +setup_tool_template: &SETUP_TOOL_TEMPLATE + setup_tool_script: + - git fetch origin master # To set FETCH_HEAD for "git merge-base" to work + - cd script/tool + - pub get + flutter_upgrade_template: &FLUTTER_UPGRADE_TEMPLATE - env: - CHANNEL: "master" # Default to master when not explicitly set by a task. upgrade_flutter_script: - flutter channel $CHANNEL - flutter upgrade + << : *SETUP_TOOL_TEMPLATE macos_template: &MACOS_TEMPLATE # Only one macOS task can run in parallel without credits, so use them for @@ -19,11 +24,8 @@ only_if: $CIRRUS_TAG == '' use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_PR == '' env: INTEGRATION_TEST_PATH: "./packages/integration_test" + CHANNEL: "master" # Default to master when not explicitly set by a task. PLUGIN_TOOLS: "dart run ./script/tool/lib/src/main.dart" -setup_tool_script: - - git fetch origin master # To set FETCH_HEAD for "git merge-base" to work - - cd script/tool - - pub get # Light-workload Linux tasks. # These use default machines, with fewer CPUs, to reduce pressure on the @@ -244,6 +246,7 @@ task: task: # Don't used FLUTTER_UPGRADE_TEMPLATE, Flutter tooling not needed. << : *MACOS_TEMPLATE + << : *SETUP_TOOL_TEMPLATE matrix: - name: lint_darwin_plugins script: From 80ce7d651d89cd6e920d52832adec3c324c73fb6 Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Wed, 10 Mar 2021 16:27:02 -0800 Subject: [PATCH 3/3] Review edits --- .cirrus.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 8d11f9571e9f..67669d783192 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,5 +1,14 @@ -setup_tool_template: &SETUP_TOOL_TEMPLATE - setup_tool_script: +# Don't run on release tags since it creates O(n^2) tasks where n is the +# number of plugins +only_if: $CIRRUS_TAG == '' +use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_PR == '' +env: + INTEGRATION_TEST_PATH: "./packages/integration_test" + CHANNEL: "master" # Default to master when not explicitly set by a task. + PLUGIN_TOOLS: "dart run ./script/tool/lib/src/main.dart" + +tool_setup_template: &TOOL_SETUP_TEMPLATE + tool_setup_script: - git fetch origin master # To set FETCH_HEAD for "git merge-base" to work - cd script/tool - pub get @@ -8,7 +17,7 @@ flutter_upgrade_template: &FLUTTER_UPGRADE_TEMPLATE upgrade_flutter_script: - flutter channel $CHANNEL - flutter upgrade - << : *SETUP_TOOL_TEMPLATE + << : *TOOL_SETUP_TEMPLATE macos_template: &MACOS_TEMPLATE # Only one macOS task can run in parallel without credits, so use them for @@ -18,15 +27,6 @@ macos_template: &MACOS_TEMPLATE image: big-sur-xcode-12.3 cocoapod_install_script: sudo gem install cocoapods -# Don't run on release tags since it creates O(n^2) tasks where n is the -# number of plugins -only_if: $CIRRUS_TAG == '' -use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_PR == '' -env: - INTEGRATION_TEST_PATH: "./packages/integration_test" - CHANNEL: "master" # Default to master when not explicitly set by a task. - PLUGIN_TOOLS: "dart run ./script/tool/lib/src/main.dart" - # Light-workload Linux tasks. # These use default machines, with fewer CPUs, to reduce pressure on the # concurrency limits. @@ -189,8 +189,8 @@ task: # macOS tasks. task: - << : *FLUTTER_UPGRADE_TEMPLATE << : *MACOS_TEMPLATE + << : *FLUTTER_UPGRADE_TEMPLATE matrix: ### iOS tasks ### - name: build_all_plugins_ipa @@ -244,9 +244,9 @@ task: - ./script/incremental_build.sh drive-examples --macos task: - # Don't used FLUTTER_UPGRADE_TEMPLATE, Flutter tooling not needed. + # Don't use FLUTTER_UPGRADE_TEMPLATE, Flutter tooling not needed. << : *MACOS_TEMPLATE - << : *SETUP_TOOL_TEMPLATE + << : *TOOL_SETUP_TEMPLATE matrix: - name: lint_darwin_plugins script: