forked from flutter/plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.cirrus.yml
286 lines (278 loc) · 11.2 KB
/
.cirrus.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
gcp_credentials: ENCRYPTED[!0e63b52bd7e4fda1cd7b7bf2b4fe515a27fadbeaced01f5ad8b699b81d3611ed64c5d3271bcd8426dd914ef41cba48a0!]
# Don't run on release tags since it creates O(n^2) tasks where n is the
# number of plugins
only_if: $CIRRUS_TAG == ''
env:
CHANNEL: "master" # Default to master when not explicitly set by a task.
PLUGIN_TOOL: "./script/tool/bin/flutter_plugin_tools.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
- dart pub get
flutter_upgrade_template: &FLUTTER_UPGRADE_TEMPLATE
upgrade_flutter_script:
# Ensure that the repository has all the branches.
- cd $FLUTTER_HOME
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
- git fetch origin
# Switch to the requested branch.
- git checkout $CHANNEL
# Reset to upstream branch, rather than using pull, since the base image
# can sometimes be in a state where it has diverged from upstream (!).
- git reset --hard @{u}
# Run doctor to allow auditing of what version of Flutter the run is using.
- flutter doctor -v
<< : *TOOL_SETUP_TEMPLATE
build_all_plugins_app_template: &BUILD_ALL_PLUGINS_APP_TEMPLATE
create_all_plugins_app_script:
- dart $PLUGIN_TOOL all-plugins-app --output-dir=. --exclude script/configs/exclude_all_plugins_app.yaml
build_all_plugins_debug_script:
- cd all_plugins
- if [[ "$BUILD_ALL_ARGS" == "web" ]]; then
- echo "Skipping; web does not support debug builds"
- else
- flutter build $BUILD_ALL_ARGS --debug
- fi
build_all_plugins_release_script:
- cd all_plugins
- flutter build $BUILD_ALL_ARGS --release
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.5
# Light-workload Linux tasks.
# These use default machines, with fewer CPUs, to reduce pressure on the
# concurrency limits.
task:
<< : *FLUTTER_UPGRADE_TEMPLATE
gke_container:
dockerfile: .ci/Dockerfile
builder_image_name: docker-builder-linux # gce vm image
builder_image_project: flutter-cirrus
cluster_name: test-cluster
zone: us-central1-a
namespace: default
matrix:
### Platform-agnostic tasks ###
- name: plugin_tools_tests
script:
- cd script/tool
- CIRRUS_BUILD_ID=null pub run test
- name: publishable
version_check_script: ./script/tool_runner.sh version-check
publish_check_script: ./script/tool_runner.sh publish-check
- name: format
format_script: ./script/tool_runner.sh format --fail-on-change
pubspec_script: ./script/tool_runner.sh pubspec-check
license_script: dart $PLUGIN_TOOL license-check
- name: test
env:
matrix:
CHANNEL: "master"
CHANNEL: "stable"
test_script:
- ./script/tool_runner.sh test
- name: analyze
env:
matrix:
CHANNEL: "master"
CHANNEL: "stable"
tool_script:
- cd script/tool
- dart analyze --fatal-infos
script:
# DO NOT change the custom-analysis argument here without changing the Dart repo.
# See the comment in script/configs/custom_analysis.yaml for details.
- ./script/tool_runner.sh analyze --custom-analysis=script/configs/custom_analysis.yaml
### Android tasks ###
- name: build_all_plugins_apk
env:
BUILD_ALL_ARGS: "apk"
matrix:
CHANNEL: "master"
CHANNEL: "stable"
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE
### Web tasks ###
- name: build_all_plugins_web
env:
BUILD_ALL_ARGS: "web"
matrix:
CHANNEL: "master"
CHANNEL: "stable"
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE
### Linux desktop tasks ###
- name: build_all_plugins_linux
env:
BUILD_ALL_ARGS: "linux"
matrix:
CHANNEL: "master"
CHANNEL: "stable"
setup_script:
- flutter config --enable-linux-desktop
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE
- name: linux-build+platform-tests
env:
matrix:
CHANNEL: "master"
CHANNEL: "stable"
build_script:
- flutter config --enable-linux-desktop
- ./script/tool_runner.sh build-examples --linux
drive_script:
- xvfb-run ./script/tool_runner.sh drive-examples --linux
# Heavy-workload Linux tasks.
# These use machines with more CPUs and memory, so will reduce parallelization
# for non-credit runs.
task:
<< : *FLUTTER_UPGRADE_TEMPLATE
gke_container:
dockerfile: .ci/Dockerfile
builder_image_name: docker-builder-linux # gce vm image
builder_image_project: flutter-cirrus
cluster_name: test-cluster
zone: us-central1-a
namespace: default
cpu: 4
memory: 12G
matrix:
### Android tasks ###
- name: android-build+platform-tests
env:
matrix:
PLUGIN_SHARDING: "--shardIndex 0 --shardCount 4"
PLUGIN_SHARDING: "--shardIndex 1 --shardCount 4"
PLUGIN_SHARDING: "--shardIndex 2 --shardCount 4"
PLUGIN_SHARDING: "--shardIndex 3 --shardCount 4"
matrix:
CHANNEL: "master"
CHANNEL: "stable"
MAPS_API_KEY: ENCRYPTED[596a9f6bca436694625ac50851dc5da6b4d34cba8025f7db5bc9465142e8cd44e15f69e3507787753accebfc4910d550]
GCLOUD_FIREBASE_TESTLAB_KEY: ENCRYPTED[07586610af1fdfc894e5969f70ef2458341b9b7e9c3b7c4225a663b4a48732b7208a4d91c3b7d45305a6b55fa2a37fc4]
build_script:
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
# might include non-ASCII characters which makes Gradle crash.
# TODO(stuartmorgan): See https://github.com/flutter/flutter/issues/24935
- export CIRRUS_CHANGE_MESSAGE=""
- export CIRRUS_COMMIT_MESSAGE=""
- ./script/tool_runner.sh build-examples --apk
lint_script:
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
# might include non-ASCII characters which makes Gradle crash.
# TODO(stuartmorgan): See https://github.com/flutter/flutter/issues/24935
- export CIRRUS_CHANGE_MESSAGE=""
- export CIRRUS_COMMIT_MESSAGE=""
- ./script/tool_runner.sh lint-android # must come after build-examples
native_unit_test_script:
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
# might include non-ASCII characters which makes Gradle crash.
# TODO(stuartmorgan): See https://github.com/flutter/flutter/issues/24935
- export CIRRUS_CHANGE_MESSAGE=""
- export CIRRUS_COMMIT_MESSAGE=""
# Native integration tests are handled by firebase-test-lab below, so
# only run unit tests.
- ./script/tool_runner.sh native-test --android --no-integration # must come after apk build
firebase_test_lab_script:
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
# might include non-ASCII characters which makes Gradle crash.
# TODO(stuartmorgan): See https://github.com/flutter/flutter/issues/24935
- export CIRRUS_CHANGE_MESSAGE=""
- export CIRRUS_COMMIT_MESSAGE=""
- if [[ -n "$GCLOUD_FIREBASE_TESTLAB_KEY" ]]; then
- echo $GCLOUD_FIREBASE_TESTLAB_KEY > ${HOME}/gcloud-service-key.json
- ./script/tool_runner.sh firebase-test-lab --device model=flame,version=29 --device model=starqlteue,version=26 --exclude=script/configs/exclude_integration_android.yaml
- else
- echo "This user does not have permission to run Firebase Test Lab tests."
- fi
# Upload the full lint results to Cirrus to display in the results UI.
always:
android-lint_artifacts:
path: "**/reports/lint-results-debug.xml"
type: text/xml
format: android-lint
### Web tasks ###
- name: web-build+platform-tests
env:
matrix:
CHANNEL: "master"
CHANNEL: "stable"
install_script:
- git clone https://github.com/flutter/web_installers.git
- cd web_installers/packages/web_drivers/
- dart pub get
- dart lib/web_driver_installer.dart chromedriver --install-only
- ./chromedriver/chromedriver --port=4444 &
build_script:
- ./script/tool_runner.sh build-examples --web
drive_script:
- ./script/tool_runner.sh drive-examples --web --exclude=script/configs/exclude_integration_web.yaml
# macOS tasks.
task:
<< : *MACOS_TEMPLATE
<< : *FLUTTER_UPGRADE_TEMPLATE
matrix:
### iOS+macOS tasks ***
- name: lint_darwin_plugins
script:
- ./script/tool_runner.sh podspecs
### iOS tasks ###
- name: build_all_plugins_ipa
env:
BUILD_ALL_ARGS: "ios --no-codesign"
matrix:
CHANNEL: "master"
CHANNEL: "stable"
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE
- name: ios-build+platform-tests
env:
PATH: $PATH:/usr/local/bin
matrix:
PLUGIN_SHARDING: "--shardIndex 0 --shardCount 4"
PLUGIN_SHARDING: "--shardIndex 1 --shardCount 4"
PLUGIN_SHARDING: "--shardIndex 2 --shardCount 4"
PLUGIN_SHARDING: "--shardIndex 3 --shardCount 4"
matrix:
CHANNEL: "master"
CHANNEL: "stable"
SIMCTL_CHILD_MAPS_API_KEY: ENCRYPTED[596a9f6bca436694625ac50851dc5da6b4d34cba8025f7db5bc9465142e8cd44e15f69e3507787753accebfc4910d550]
create_simulator_script:
- xcrun simctl list
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-11 com.apple.CoreSimulator.SimRuntime.iOS-14-5 | xargs xcrun simctl boot
build_script:
- ./script/tool_runner.sh build-examples --ios
xcode_analyze_script:
- ./script/tool_runner.sh xcode-analyze --ios
native_test_script:
- ./script/tool_runner.sh native-test --ios --ios-destination "platform=iOS Simulator,name=iPhone 11,OS=latest"
drive_script:
# `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/tool_runner.sh drive-examples --ios --exclude=script/configs/exclude_integration_ios.yaml
### macOS desktop tasks ###
- name: build_all_plugins_macos
env:
BUILD_ALL_ARGS: "macos"
matrix:
CHANNEL: "master"
CHANNEL: "stable"
setup_script:
- flutter config --enable-macos-desktop
<< : *BUILD_ALL_PLUGINS_APP_TEMPLATE
- name: macos-build+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
native_test_script:
- ./script/tool_runner.sh native-test --macos --exclude=script/configs/exclude_native_macos.yaml
drive_script:
- ./script/tool_runner.sh drive-examples --macos