@@ -20,10 +20,28 @@ flutter_upgrade_template: &FLUTTER_UPGRADE_TEMPLATE
2020 - git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
2121 - git fetch origin
2222 # Switch to the requested branch.
23- - flutter channel $CHANNEL
24- - flutter upgrade
23+ - git checkout $CHANNEL
24+ # Reset to upstream branch, rather than using pull, since the base image
25+ # can sometimes be in a state where it has diverged from upstream (!).
26+ - git reset --hard @{u}
27+ # Run doctor to allow auditing of what version of Flutter the run is using.
28+ - flutter doctor -v
2529 << : *TOOL_SETUP_TEMPLATE
2630
31+ build_all_plugins_app_template : &BUILD_ALL_PLUGINS_APP_TEMPLATE
32+ create_all_plugins_app_script :
33+ - dart $PLUGIN_TOOL all-plugins-app --output-dir=. --exclude script/configs/exclude_all_plugins_app.yaml
34+ build_all_plugins_debug_script :
35+ - cd all_plugins
36+ - if [[ "$BUILD_ALL_ARGS" == "web" ]]; then
37+ - echo "Skipping; web does not support debug builds"
38+ - else
39+ - flutter build $BUILD_ALL_ARGS --debug
40+ - fi
41+ build_all_plugins_release_script :
42+ - cd all_plugins
43+ - flutter build $BUILD_ALL_ARGS --release
44+
2745macos_template : &MACOS_TEMPLATE
2846 # Only one macOS task can run in parallel without credits, so use them for
2947 # PRs on macOS.
@@ -72,40 +90,45 @@ task:
7290 - cd script/tool
7391 - dart analyze --fatal-infos
7492 script :
75- - ./script/tool_runner.sh analyze
93+ # DO NOT change the custom-analysis argument here without changing the Dart repo.
94+ # See the comment in script/configs/custom_analysis.yaml for details.
95+ - ./script/tool_runner.sh analyze --custom-analysis=script/configs/custom_analysis.yaml
7696 # ## Android tasks ###
7797 - name : build_all_plugins_apk
7898 env :
99+ BUILD_ALL_ARGS : " apk"
79100 matrix :
80101 CHANNEL : " master"
81102 CHANNEL : " stable"
82- script :
83- - ./script/build_all_plugins_app.sh apk
103+ << : *BUILD_ALL_PLUGINS_APP_TEMPLATE
84104 # ## Web tasks ###
85105 - name : build_all_plugins_web
86106 env :
107+ BUILD_ALL_ARGS : " web"
87108 matrix :
88109 CHANNEL : " master"
89110 CHANNEL : " stable"
90- script :
91- - ./script/build_all_plugins_app.sh web
111+ << : *BUILD_ALL_PLUGINS_APP_TEMPLATE
92112 # ## Linux desktop tasks ###
93113 - name : build_all_plugins_linux
94114 env :
115+ BUILD_ALL_ARGS : " linux"
95116 matrix :
96117 CHANNEL : " master"
97118 CHANNEL : " stable"
98- script :
119+ setup_script :
99120 - flutter config --enable-linux-desktop
100- - ./script/build_all_plugins_app.sh linux
101- - name : build- linux+drive-examples
121+ << : *BUILD_ALL_PLUGINS_APP_TEMPLATE
122+ - name : linux-build+platform-tests
102123 env :
103124 matrix :
104125 CHANNEL : " master"
105126 CHANNEL : " stable"
106127 build_script :
107128 - flutter config --enable-linux-desktop
108129 - ./script/tool_runner.sh build-examples --linux
130+ native_test_script :
131+ - ./script/tool_runner.sh native-test --linux --no-integration
109132 drive_script :
110133 - xvfb-run ./script/tool_runner.sh drive-examples --linux
111134
@@ -125,7 +148,7 @@ task:
125148 memory : 12G
126149 matrix :
127150 # ## Android tasks ###
128- - name : build-apks+java-test+firebase-test-lab
151+ - name : android-build+platform-tests
129152 env :
130153 matrix :
131154 PLUGIN_SHARDING : " --shardIndex 0 --shardCount 4"
@@ -144,13 +167,22 @@ task:
144167 - export CIRRUS_CHANGE_MESSAGE=""
145168 - export CIRRUS_COMMIT_MESSAGE=""
146169 - ./script/tool_runner.sh build-examples --apk
147- java_test_script :
170+ lint_script :
148171 # Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
149172 # might include non-ASCII characters which makes Gradle crash.
150173 # TODO(stuartmorgan): See https://github.com/flutter/flutter/issues/24935
151174 - export CIRRUS_CHANGE_MESSAGE=""
152175 - export CIRRUS_COMMIT_MESSAGE=""
153- - ./script/tool_runner.sh java-test # must come after apk build
176+ - ./script/tool_runner.sh lint-android # must come after build-examples
177+ native_unit_test_script :
178+ # Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
179+ # might include non-ASCII characters which makes Gradle crash.
180+ # TODO(stuartmorgan): See https://github.com/flutter/flutter/issues/24935
181+ - export CIRRUS_CHANGE_MESSAGE=""
182+ - export CIRRUS_COMMIT_MESSAGE=""
183+ # Native integration tests are handled by firebase-test-lab below, so
184+ # only run unit tests.
185+ - ./script/tool_runner.sh native-test --android --no-integration # must come after apk build
154186 firebase_test_lab_script :
155187 # Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
156188 # might include non-ASCII characters which makes Gradle crash.
@@ -159,16 +191,19 @@ task:
159191 - export CIRRUS_COMMIT_MESSAGE=""
160192 - if [[ -n "$GCLOUD_FIREBASE_TESTLAB_KEY" ]]; then
161193 - echo $GCLOUD_FIREBASE_TESTLAB_KEY > ${HOME}/gcloud-service-key.json
162- - ./script/tool_runner.sh firebase-test-lab --device model=flame,version=29 --device model=starqlteue,version=26
194+ - ./script/tool_runner.sh firebase-test-lab --device model=flame,version=29 --device model=starqlteue,version=26 --exclude=script/configs/exclude_integration_android.yaml
163195 - else
164196 - echo "This user does not have permission to run Firebase Test Lab tests."
165197 - fi
198+ # Upload the full lint results to Cirrus to display in the results UI.
199+ always :
200+ android-lint_artifacts :
201+ path : " **/reports/lint-results-debug.xml"
202+ type : text/xml
203+ format : android-lint
166204 # ## Web tasks ###
167- - name : build- web+drive-examples
205+ - name : web-build+platform-tests
168206 env :
169- # Currently missing; see https://github.com/flutter/flutter/issues/81982
170- # and https://github.com/flutter/flutter/issues/82211
171- PLUGINS_TO_EXCLUDE_INTEGRATION_TESTS : " file_selector,shared_preferences_web"
172207 matrix :
173208 CHANNEL : " master"
174209 CHANNEL : " stable"
@@ -181,7 +216,7 @@ task:
181216 build_script :
182217 - ./script/tool_runner.sh build-examples --web
183218 drive_script :
184- - ./script/tool_runner.sh drive-examples --web --exclude $PLUGINS_TO_EXCLUDE_INTEGRATION_TESTS
219+ - ./script/tool_runner.sh drive-examples --web --exclude=script/configs/exclude_integration_web.yaml
185220
186221# macOS tasks.
187222task :
@@ -195,18 +230,14 @@ task:
195230 # ## iOS tasks ###
196231 - name : build_all_plugins_ipa
197232 env :
233+ BUILD_ALL_ARGS : " ios --no-codesign"
198234 matrix :
199235 CHANNEL : " master"
200236 CHANNEL : " stable"
201- script :
202- - ./script/build_all_plugins_app.sh ios --no-codesign
203- - name : build-ipas+drive-examples
237+ << : *BUILD_ALL_PLUGINS_APP_TEMPLATE
238+ - name : ios-build+platform-tests
204239 env :
205240 PATH : $PATH:/usr/local/bin
206- # in_app_purchase_ios is currently missing tests; see https://github.com/flutter/flutter/issues/81695
207- # ios_platform_images is currently missing tests; see https://github.com/flutter/flutter/issues/82208
208- # sensor hangs on CI.
209- PLUGINS_TO_EXCLUDE_INTEGRATION_TESTS : " in_app_purchase_ios,ios_platform_images,sensors"
210241 matrix :
211242 PLUGIN_SHARDING : " --shardIndex 0 --shardCount 4"
212243 PLUGIN_SHARDING : " --shardIndex 1 --shardCount 4"
@@ -221,35 +252,37 @@ task:
221252 - xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-11 com.apple.CoreSimulator.SimRuntime.iOS-14-5 | xargs xcrun simctl boot
222253 build_script :
223254 - ./script/tool_runner.sh build-examples --ios
224- xctest_script :
225- - ./script/tool_runner.sh xctest --ios --ios-destination "platform=iOS Simulator,name=iPhone 11,OS=latest"
255+ xcode_analyze_script :
256+ - ./script/tool_runner.sh xcode-analyze --ios
257+ native_test_script :
258+ - ./script/tool_runner.sh native-test --ios --ios-destination "platform=iOS Simulator,name=iPhone 11,OS=latest"
226259 drive_script :
227260 # `drive-examples` contains integration tests, which changes the UI of the application.
228261 # This UI change sometimes affects `xctest`.
229- # So we run `drive-examples` after `xctest`, changing the order will result ci failure.
230- - ./script/tool_runner.sh drive-examples --ios --exclude $PLUGINS_TO_EXCLUDE_INTEGRATION_TESTS
262+ # So we run `drive-examples` after `native-test`; changing the order will result ci failure.
263+ - ./script/tool_runner.sh drive-examples --ios --exclude=script/configs/exclude_integration_ios.yaml
231264 # ## macOS desktop tasks ###
232265 - name : build_all_plugins_macos
233266 env :
267+ BUILD_ALL_ARGS : " macos"
234268 matrix :
235269 CHANNEL : " master"
236270 CHANNEL : " stable"
237- script :
271+ setup_script :
238272 - flutter config --enable-macos-desktop
239- - ./script/build_all_plugins_app.sh macos
240- - name : build- macos+drive-examples
273+ << : *BUILD_ALL_PLUGINS_APP_TEMPLATE
274+ - name : macos-build+platform-tests
241275 env :
242- # conncectivity_macos is deprecated, so is not getting unit test backfill.
243- # package_info is deprecated, so is not getting unit test backfill.
244- PLUGINS_TO_EXCLUDE_MACOS_XCTESTS : " connectivity_macos,package_info"
245276 matrix :
246277 CHANNEL : " master"
247278 CHANNEL : " stable"
248279 PATH : $PATH:/usr/local/bin
249280 build_script :
250281 - flutter config --enable-macos-desktop
251282 - ./script/tool_runner.sh build-examples --macos
252- xctest_script :
253- - ./script/tool_runner.sh xctest --macos --exclude $PLUGINS_TO_EXCLUDE_MACOS_XCTESTS
283+ xcode_analyze_script :
284+ - ./script/tool_runner.sh xcode-analyze --macos
285+ native_test_script :
286+ - ./script/tool_runner.sh native-test --macos --exclude=script/configs/exclude_native_macos.yaml
254287 drive_script :
255288 - ./script/tool_runner.sh drive-examples --macos
0 commit comments