-
Notifications
You must be signed in to change notification settings - Fork 42
/
bitrise.yml
293 lines (285 loc) · 7.31 KB
/
bitrise.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
287
288
289
290
291
292
293
---
format_version: '11'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: flutter
trigger_map: []
pipelines:
primary:
stages:
- stage_build: {}
- stage_integration_test: {}
pull_request:
stages:
- stage_build: {}
- stage_integration_test: {}
nightly:
stages:
- nightly: {}
stages:
stage_build:
workflows:
- core_build: {}
stage_integration_test:
workflows:
- integration_ios_from_stage: {}
- integration_android_from_stage: {}
# Bitrise is stalling on this step unfortunately
# - integration_web_from_stage: {}
nightly:
workflows:
- nightly_ios: {}
- nightly_android: {}
workflows:
_deploy_artifacts:
steps:
- deploy-to-bitrise-io: {}
- deploy-to-bitrise-io:
inputs:
- deploy_path: "$BITRISE_SOURCE_DIR/.build/test-results/"
_flutter_install:
steps:
- flutter-installer@0:
inputs:
- version: "$FLUTTER_VERSION"
_launch_ios_simulator:
steps:
- script:
title: Launch iOS Simulator
inputs:
- content: |-
#!/usr/bin/env bash
set -e
flutter emulators --launch apple_ios_simulator
# Sleep while the simulator warms a bit
sleep 5
_setup:
before_run:
- _flutter_install
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- [email protected]: {}
- cache-pull@2: {}
- set-java-version@1:
inputs:
- set_java_version: '17'
- script:
title: Generate build files
inputs:
- content: |-
#!/usr/bin/env bash
set -e
dart pub global activate melos
melos bootstrap
if [ "$(uname)" == "Darwin" ]; then
flutter precache --ios
pod repo update
melos pub:get
melos pod_update --no-select
fi
mkdir -p $BITRISE_SOURCE_DIR/.build/test-results/
melos prepare
- script:
title: Dart 2.15 fix junitreport
inputs:
- content: |-
#!/user/bin/env bash
set -e
dart pub global activate junitreport
_start_android_emulator:
steps:
- avd-manager@1:
inputs:
- api_level: '30'
- emulator_channel: 0
- wait-for-android-emulator@1:
title: Wait for Android Emulator
analyze:
steps:
- script:
title: Analyze
inputs:
- content: |-
melos analyze
build:
steps:
- script:
title: Build
inputs:
- content: |-
melos build
check_dependencies:
steps:
- script:
title: Check dependencies
inputs:
- content: |-
#!/usr/bin/env bash
set -e
dart pub get
dart ./bin/third_party_scanner.dart
- working_dir: "$BITRISE_SOURCE_DIR/tools/third_party_scanner"
core_build:
envs:
- IOS_SIMULATOR: "iPhone 14"
- FLUTTER_VERSION: stable
after_run:
- _setup
- check_dependencies
- analyze
- build
- unit_test
- _deploy_artifacts
integration_android:
steps:
- script:
title: Android Integration Tests
inputs:
- content: |-
#!/usr/bin/env bash
set -e
melos integration_test:android
meta:
bitrise.io:
stack: linux-docker-android-20.04
machine_type_id: standard
integration_android_from_stage:
envs:
- FLUTTER_VERSION: stable
after_run:
- _setup
- _start_android_emulator
- integration_android
- _deploy_artifacts
meta:
bitrise.io:
stack: linux-docker-android-20.04
machine_type_id: standard
integration_ios:
envs:
- IOS_SIMULATOR: "iPhone 14"
steps:
- script:
title: iOS Integration Tests
inputs:
- content: |-
#!/usr/bin/env bash
set -e
melos integration_test:ios
integration_ios_from_stage:
envs:
- FLUTTER_VERSION: stable
after_run:
- _setup
- _launch_ios_simulator
- integration_ios
- _deploy_artifacts
_install_chrome:
steps:
- script:
title: Install Chrome and chromedriver (and start chromedriver)
inputs:
- content: |-
#!/usr/bin/env bash
# Chrome install
sudo apt update
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt-get install -f
# Chrome driver install
export CHROME_LATEST_STABLE=`curl https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_STABLE`
wget https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$CHROME_LATEST_STABLE/linux64/chromedriver-linux64.zip
unzip chromedriver-linux64.zip
chmod +x ./chromedriver-linux64/chromedriver
./chromedriver-linux64/chromedriver --port=4444 &
integration_web:
steps:
- script:
title: Web integration tests
inputs:
- content: |-
#!/usr/bin/env bash
set -e
melos integration_test:web:main
integration_web_from_stage:
envs:
- FLUTTER_VERSION: stable
after_run:
- _setup
- _install_chrome
- integration_web
- _deploy_artifacts
meta:
bitrise.io:
stack: linux-docker-android-20.04
machine_type_id: standard
nightly_android:
envs:
- FLUTTER_VERSION: stable
before_run:
- _setup
- _start_android_emulator
steps:
- flutter-test@1:
inputs:
- project_location: "$BITRISE_SOURCE_DIR/packages/datadog_flutter_plugin/e2e_test_app"
- tests_path_pattern: integration_test
- additional_params: "-d emulator"
after_run:
- _deploy_artifacts
meta:
bitrise.io:
stack: linux-docker-android-20.04
machine_type_id: standard
nightly_ios:
envs:
- FLUTTER_VERSION: stable
before_run:
- _setup
- _launch_ios_simulator
steps:
- script:
title: Run flutter doctor
inputs:
- content: |-
#!/usr/bin/env/ bash
flutter doctor
- working_dir: "$BITRISE_SOURCE_DIR"
- script:
title: Update pods
inputs:
- content: |-
#!/usr/bin/env/ bash
pod update --repo-update
- working_dir: "$BITRISE_SOURCE_DIR/packages/datadog_flutter_plugin/e2e_test_app/ios"
- flutter-test@1:
inputs:
- project_location: "$BITRISE_SOURCE_DIR/packages/datadog_flutter_plugin/e2e_test_app"
- tests_path_pattern: integration_test
- additional_params: "-d iPhone"
after_run:
- _deploy_artifacts
unit_test:
steps:
- script:
title: All Unit Tests
inputs:
- content: |-
#!/usr/bin/env bash
set -e
melos unit_test:all
meta:
bitrise.io:
stack: osx-xcode-14.3.x-ventura
machine_type_id: g2-m1.4core
app:
envs:
- opts:
is_expand: false
BITRISE_FLUTTER_PROJECT_LOCATION: "."
- opts:
is_expand: false
IS_ON_CI: 'true'
- opts:
is_expand: false
FLUTTER_VERSION: stable