Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit aeab040

Browse files
[ci] Cirrus pre-alignment with flutter/packages, part 1 (#6569)
1 parent 79894bc commit aeab040

File tree

2 files changed

+60
-59
lines changed

2 files changed

+60
-59
lines changed

.ci/scripts/prepare_tool.sh

100644100755
File mode changed.

.cirrus.yml

Lines changed: 60 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,26 @@ gcp_credentials: ENCRYPTED[!f1177d1ddb5330ffaa9ea11c9c9e8e0c542185e895c36071f18c
44
only_if: $CIRRUS_TAG == '' && ($CIRRUS_PR != '' || $CIRRUS_BRANCH == 'main')
55
env:
66
CHANNEL: "master" # Default to master when not explicitly set by a task.
7-
PLUGIN_TOOL: "./script/tool/bin/flutter_plugin_tools.dart"
7+
PLUGIN_TOOL_COMMAND: "dart ./script/tool/bin/flutter_plugin_tools.dart"
88

99
tool_setup_template: &TOOL_SETUP_TEMPLATE
1010
tool_setup_script:
11-
- git fetch origin main # To set FETCH_HEAD for "git merge-base" to work
12-
- cd script/tool
13-
- dart pub get
11+
- .ci/scripts/prepare_tool.sh
12+
13+
macos_template: &MACOS_TEMPLATE
14+
# Only one macOS task can run in parallel without credits, so use them for
15+
# PRs on macOS.
16+
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
17+
18+
macos_intel_template: &MACOS_INTEL_TEMPLATE
19+
<< : *MACOS_TEMPLATE
20+
osx_instance:
21+
image: big-sur-xcode-13
22+
23+
macos_arm_template: &MACOS_ARM_TEMPLATE
24+
<< : *MACOS_TEMPLATE
25+
macos_instance:
26+
image: ghcr.io/cirruslabs/macos-ventura-xcode:14
1427

1528
flutter_upgrade_template: &FLUTTER_UPGRADE_TEMPLATE
1629
upgrade_flutter_script:
@@ -39,7 +52,7 @@ flutter_upgrade_template: &FLUTTER_UPGRADE_TEMPLATE
3952

4053
build_all_plugins_app_template: &BUILD_ALL_PLUGINS_APP_TEMPLATE
4154
create_all_plugins_app_script:
42-
- dart $PLUGIN_TOOL all-plugins-app --output-dir=. --exclude script/configs/exclude_all_plugins_app.yaml
55+
- $PLUGIN_TOOL_COMMAND all-plugins-app --output-dir=. --exclude script/configs/exclude_all_plugins_app.yaml
4356
build_all_plugins_debug_script:
4457
- cd all_plugins
4558
- if [[ "$BUILD_ALL_ARGS" == "web" ]]; then
@@ -51,21 +64,6 @@ build_all_plugins_app_template: &BUILD_ALL_PLUGINS_APP_TEMPLATE
5164
- cd all_plugins
5265
- flutter build $BUILD_ALL_ARGS --release
5366

54-
macos_template: &MACOS_TEMPLATE
55-
# Only one macOS task can run in parallel without credits, so use them for
56-
# PRs on macOS.
57-
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
58-
59-
macos_intel_template: &MACOS_INTEL_TEMPLATE
60-
<< : *MACOS_TEMPLATE
61-
osx_instance:
62-
image: big-sur-xcode-13
63-
64-
macos_arm_template: &MACOS_ARM_TEMPLATE
65-
<< : *MACOS_TEMPLATE
66-
macos_instance:
67-
image: ghcr.io/cirruslabs/macos-ventura-xcode:14
68-
6967
# Light-workload Linux tasks.
7068
# These use default machines, with fewer CPUs, to reduce pressure on the
7169
# concurrency limits.
@@ -84,22 +82,13 @@ task:
8482
script:
8583
- cd script/tool
8684
- dart pub run test
87-
- name: publishable
88-
version_check_script:
89-
# For pre-submit, pass the PR labels to the script to allow for version
90-
# check overrides.
91-
# For post-submit, ignore platform version breaking version changes and
92-
# missing version/CHANGELOG detection since the labels aren't
93-
# available outside of the context of the PR.
94-
- if [[ $CIRRUS_PR == "" ]]; then
95-
- ./script/tool_runner.sh version-check --ignore-platform-interface-breaks
96-
- else
97-
- ./script/tool_runner.sh version-check --check-for-missing-changes --pr-labels="$CIRRUS_PR_LABELS"
98-
- fi
99-
publish_check_script: ./script/tool_runner.sh publish-check
100-
- name: format
85+
# Repository rules and best-practice enforcement.
86+
# Only channel-agnostic tests should go here since it is only run once
87+
# (on Flutter master).
88+
- name: repo_checks
10189
always:
10290
format_script: ./script/tool_runner.sh format --fail-on-change
91+
license_script: $PLUGIN_TOOL_COMMAND license-check
10392
pubspec_script: ./script/tool_runner.sh pubspec-check
10493
readme_script:
10594
- ./script/tool_runner.sh readme-check
@@ -108,19 +97,33 @@ task:
10897
# has been fixed, this can be removed and there can just be a single
10998
# run with --require-excerpts and no exclusions.
11099
- ./script/tool_runner.sh readme-check --require-excerpts --exclude=script/configs/temp_exclude_excerpt.yaml
111-
license_script: dart $PLUGIN_TOOL license-check
112-
dependabot_script: dart $PLUGIN_TOOL dependabot-check
113-
- name: federated_safety
114-
# This check is only meaningful for PRs, as it validates changes
115-
# rather than state.
116-
only_if: $CIRRUS_PR != ""
117-
script: ./script/tool_runner.sh federation-safety-check
100+
dependabot_script: $PLUGIN_TOOL_COMMAND dependabot-check
101+
version_script:
102+
# For pre-submit, pass the PR labels to the script to allow for
103+
# check overrides.
104+
# For post-submit, ignore platform version breaking version changes
105+
# and missing version/CHANGELOG detection since the labels aren't
106+
# available outside of the context of the PR.
107+
- if [[ $CIRRUS_PR == "" ]]; then
108+
- ./script/tool_runner.sh version-check --ignore-platform-interface-breaks
109+
- else
110+
- ./script/tool_runner.sh version-check --check-for-missing-changes --pr-labels="$CIRRUS_PR_LABELS"
111+
- fi
112+
publishable_script: ./script/tool_runner.sh publish-check --allow-pre-release
113+
federated_safety_script:
114+
# This check is only meaningful for PRs, as it validates changes
115+
# rather than state.
116+
- if [[ $CIRRUS_PR == "" ]]; then
117+
- ./script/tool_runner.sh federation-safety-check
118+
- else
119+
- echo "Only run in presubmit"
120+
- fi
118121
- name: dart_unit_tests
119122
env:
120123
matrix:
121124
CHANNEL: "master"
122125
CHANNEL: "stable"
123-
test_script:
126+
unit_test_script:
124127
- ./script/tool_runner.sh test
125128
- name: analyze
126129
env:
@@ -142,39 +145,42 @@ task:
142145
# This uses --run-on-dirty-packages rather than --packages-for-branch
143146
# since only the packages changed by 'make-deps-path-based' need to be
144147
# checked.
145-
- dart $PLUGIN_TOOL analyze --run-on-dirty-packages --log-timing --custom-analysis=script/configs/custom_analysis.yaml
148+
- $PLUGIN_TOOL_COMMAND analyze --run-on-dirty-packages --log-timing --custom-analysis=script/configs/custom_analysis.yaml
146149
# Restore the tree to a clean state, to avoid accidental issues if
147150
# other script steps are added to this task.
148151
- git checkout .
149-
# Does a sanity check that plugins at least pass analysis on the N-1 and N-2
150-
# versions of Flutter stable if the plugin claims to support that version.
152+
# Does a sanity check that packages at least pass analysis on the N-1 and N-2
153+
# versions of Flutter stable if the package claims to support that version.
151154
# This is to minimize accidentally making changes that break old versions
152155
# (which we don't commit to supporting, but don't want to actively break)
153156
# without updating the constraints.
154157
# Note: The versions below should be manually updated after a new stable
155158
# version comes out.
156-
- name: legacy-version-analyze
159+
- name: legacy_version_analyze
157160
depends_on: analyze
158-
env:
159-
matrix:
161+
matrix:
162+
env:
160163
CHANNEL: "3.0.5"
164+
DART_VERSION: "2.17.6"
165+
env:
161166
CHANNEL: "2.10.5"
167+
DART_VERSION: "2.16.2"
162168
package_prep_script:
163-
# Allow analyzing plugins that use a Pigeon version with a higher
164-
# minimum Flutter/Dart version than the plugin itself.
169+
# Allow analyzing packages that use a dev dependency with a higher
170+
# minimum Flutter/Dart version than the package itself.
165171
- ./script/tool_runner.sh remove-dev-dependencies
166172
analyze_script:
167173
# Only analyze lib/; non-client code doesn't need to work on
168174
# all supported legacy version.
169-
- ./script/tool_runner.sh analyze --lib-only --skip-if-not-supporting-flutter-version="$CHANNEL" --custom-analysis=script/configs/custom_analysis.yaml
170-
# Does a sanity check that plugins pass analysis with the lowest possible
175+
- ./script/tool_runner.sh analyze --lib-only --skip-if-not-supporting-flutter-version="$CHANNEL" --skip-if-not-supporting-dart-version="$DART_VERSION" --custom-analysis=script/configs/custom_analysis.yaml
176+
# Does a sanity check that packages pass analysis with the lowest possible
171177
# versions of all dependencies. This is to catch cases where we add use of
172-
# new APIs but forget to update minimum versions of dependencies to when
178+
# new APIs but forget to update minimum versions of dependencies to where
173179
# those APIs are introduced.
174180
- name: downgraded_analyze
175181
depends_on: analyze
176182
analyze_script:
177-
- ./script/tool_runner.sh analyze --downgrade
183+
- ./script/tool_runner.sh analyze --downgrade --custom-analysis=script/configs/custom_analysis.yaml
178184
- name: readme_excerpts
179185
env:
180186
CIRRUS_CLONE_SUBMODULES: true
@@ -194,8 +200,6 @@ task:
194200
matrix:
195201
CHANNEL: "master"
196202
CHANNEL: "stable"
197-
setup_script:
198-
- flutter config --enable-linux-desktop
199203
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE
200204
- name: linux-platform_tests
201205
# Don't run full platform tests on both channels in pre-submit.
@@ -205,7 +209,6 @@ task:
205209
CHANNEL: "master"
206210
CHANNEL: "stable"
207211
build_script:
208-
- flutter config --enable-linux-desktop
209212
- ./script/tool_runner.sh build-examples --linux
210213
native_test_script:
211214
- xvfb-run ./script/tool_runner.sh native-test --linux --no-integration
@@ -339,7 +342,6 @@ task:
339342
CHANNEL: "stable"
340343
PATH: $PATH:/usr/local/bin
341344
build_script:
342-
- flutter config --enable-macos-desktop
343345
- ./script/tool_runner.sh build-examples --macos
344346
xcode_analyze_script:
345347
- ./script/tool_runner.sh xcode-analyze --macos
@@ -408,5 +410,4 @@ task:
408410
CHANNEL: "master"
409411
CHANNEL: "stable"
410412
setup_script:
411-
- flutter config --enable-macos-desktop
412413
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE

0 commit comments

Comments
 (0)