forked from flutter/packages
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.cirrus.yml
140 lines (134 loc) · 5.48 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
gcp_credentials: ENCRYPTED[!cc769765170bebc37e0556e2da5915ca64ee37f4ec8c966ec147e2f59578b476c99e457eafce4e2f8b1a4e305f7096b8!]
env:
CHANNEL: "master" # Default to master when not explicitly set by a task.
tool_setup_template: &TOOL_SETUP_TEMPLATE
tool_setup_script:
- .ci/scripts/prepare_tool.sh
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
task:
gke_container:
dockerfile: .ci/Dockerfile
builder_image_name: docker-builder # gce vm image
builder_image_project: flutter-cirrus
cluster_name: test-cluster
zone: us-central1-a
namespace: default
cpu: 4
memory: 8G
<< : *FLUTTER_UPGRADE_TEMPLATE
matrix:
- name: format+analyze
always:
format_script: ./script/tool_runner.sh format --fail-on-change
license_script: dart pub global run flutter_plugin_tools license-check
analyze_script: ./script/tool_runner.sh analyze --custom-analysis=web_benchmarks/testing/test_app,flutter_lints/example,rfw/example
pubspec_script: ./script/tool_runner.sh pubspec-check
- name: publishable
env:
# TODO(stuartmorgan): Remove once the fix for https://github.com/dart-lang/pub/issues/3152
# rolls into Flutter master.
CHANNEL: stable
CHANGE_DESC: "/tmp/change-description.txt"
version_script:
# For pre-submit, pass the PR description to the script to allow for
# version check overrides.
# For post-submit, ignore missing version/CHANGELOG detection; the PR
# description isn't reliably part of the commit message, so using the
# same flags as for presubmit would likely result in false-positive
# post-submit failures.
- if [[ $CIRRUS_PR == "" ]]; then
- ./script/tool_runner.sh version-check
- else
- echo "$CIRRUS_CHANGE_MESSAGE" > "$CHANGE_DESC"
- ./script/tool_runner.sh version-check --check-for-missing-changes --change-description-file="$CHANGE_DESC"
- fi
publishable_script: ./script/tool_runner.sh publish-check
depends_on:
- format+analyze
- name: test
# Exclude flutter_image; its tests need a test server, so are run via local_tests.sh
script: ./script/tool_runner.sh test --exclude=flutter_image
depends_on:
- format+analyze
- name: android-build+platform-tests
env:
matrix:
CHANNEL: "master"
CHANNEL: "stable"
script:
# extension_google_sign_in_as_googleapis_auth is currently not building, see
# https://github.com/flutter/flutter/issues/89301
# rfw is excluded until the next Flutter stable release because it depends
# on features that have never shipped to stable. (The rfw package has
# never worked on stable so this is not going to break anyone.)
# When updating this, also look at the ios tests below.
# When updating this, also update the `rfw/run_tests.sh` file.
- if [[ "$CHANNEL" == "master" ]]; then
- ./script/tool_runner.sh build-examples --apk --exclude=extension_google_sign_in_as_googleapis_auth
- ./script/tool_runner.sh native-test --android --no-integration
- else
- ./script/tool_runner.sh build-examples --apk --exclude=extension_google_sign_in_as_googleapis_auth,rfw
- ./script/tool_runner.sh native-test --android --no-integration --exclude=rfw
- fi
depends_on:
- format+analyze
- name: web_benchmarks_test
env:
CHROME_NO_SANDBOX: true
install_chromium_script:
- ./script/install_chromium.sh
script:
- export CHROME_EXECUTABLE=$(pwd)/.chromium/chrome-linux/chrome
- cd packages/web_benchmarks/testing/test_app
- flutter packages get
- cd ../..
- flutter packages get
- dart testing/web_benchmarks_test.dart
task:
name: ios-build+platform-test
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
osx_instance:
image: big-sur-xcode-12.4
env:
PATH: $PATH:/usr/local/bin
matrix:
CHANNEL: "master"
CHANNEL: "stable"
<< : *FLUTTER_UPGRADE_TEMPLATE
build_script:
# Exclude rfw until the next Flutter stable release because it depends
# on features that have never shipped to stable. (The rfw package has
# never worked on stable so this is not going to break anyone.)
# When updating this, also look at the android tests above.
# When updating this, also update the `rfw/run_tests.sh` file.
- if [[ "$CHANNEL" == "master" ]]; then
- ./script/tool_runner.sh build-examples --ios
- else
- ./script/tool_runner.sh build-examples --ios --exclude=rfw
- fi
task:
name: local_tests
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
osx_instance:
image: big-sur-xcode-12.4
env:
PATH: $PATH:/usr/local/bin
matrix:
CHANNEL: "master"
CHANNEL: "stable"
<< : *FLUTTER_UPGRADE_TEMPLATE
local_tests_script:
- ./script/local_tests.sh