-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathmelos.yaml
More file actions
326 lines (281 loc) · 9.69 KB
/
melos.yaml
File metadata and controls
326 lines (281 loc) · 9.69 KB
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
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
name: datadog_flutter
packages:
- packages/*
- packages/*/example
- packages/*/integration_test_app
- packages/*/e2e_test_app
scripts:
build:
run: melos build:ios && melos build:android && melos build:web
build:ios:
exec:
concurrency: 1
run: cd example && flutter clean && flutter build ios --release --no-codesign
packageFilters:
dirExists: example/ios
full_clean:
exec:
concurrency: 1
run:
flutter clean &&
rm pubspec.lock
build:android:
exec:
concurrency: 1
run: cd example && flutter build apk --release
packageFilters:
dirExists: example/android
build:web:
exec:
concurrency: 1
run: cd example && flutter build web
packageFilters:
dirExists: example/web
lint_fix:
run: melos lint_fix:ios && melos lint_fix:android
lint_fix:ios:
exec:
concurrency: 1
run: swiftlint --fix
description: |
Run swiftlint --fix
packageFilters:
dirExists: ios
lint_fix:android:
exec:
concurrency: 1
run:
cd example/android
./gradlew ktlintFormat
description: |
Run ktlintFormat
packageFilters:
dirExists: example/android
analyze:
run: melos analyze:dart && melos analyze:android && melos analyze:ios
analyze:dart:
exec: dart analyze .
description: |
Run `dart analyze` in all packages
analyze:android:
exec:
concurrency: 1
run: |
cd example/android
./gradlew --console=plain --quiet ktlintCheck detekt
packageFilters:
dirExists: android
ignore:
- "*example*"
- "*integration_test_app*"
- "*e2e_test_app*"
analyze:ios:
exec: cd ios && swiftlint
packageFilters:
dirExists: ios
ignore:
- "*example*"
- "*integration_test_app*"
- "*e2e_test_app*"
unit_test:all:
run: melos unit_test:flutter && melos unit_test:ios && melos unit_test:android && melos unit_test:web
unit_test:flutter:
run:
mkdir -p .build/test-results &&
melos exec -c 1 -- "set -e -o pipefail && flutter test --machine | tojunit \"--output\" \"$MELOS_ROOT_PATH/.build/test-results/\$MELOS_PACKAGE_NAME_unit.xml\""
packageFilters:
dirExists: 'test'
golden_test:flutter:
exec:
concurrency: 1
run:
cd example &&
mkdir -p "$MELOS_ROOT_PATH/.build/test-results" &&
set -e -o pipefail &&
flutter test golden_test --machine | tojunit --output "$MELOS_ROOT_PATH/.build/test-results/\$MELOS_PACKAGE_NAME_golden.xml"
packageFilters:
dirExists: 'example/golden_test'
unit_test:web:
run:
mkdir -p $MELOS_ROOT_PATH/.build/test-results &&
melos exec -c 1 -- "bash -c 'set -euxo pipefail; flutter test --machine --platform chrome | tojunit \"--output\" \"$MELOS_ROOT_PATH/.build/test-results/\$MELOS_PACKAGE_NAME_unit_web.xml\"'"
# melos exec -c 1 -- "bash -c 'set -euxo pipefail; flutter test --machine --platform chrome --wasm | tojunit \"--output\" \"$MELOS_ROOT_PATH/.build/test-results/\$MELOS_PACKAGE_NAME_unit_web_wasm.xml\"'"
packageFilters:
scope: 'datadog_flutter_plugin'
unit_test:ios:
exec:
concurrency: 1
run:
set -euxo pipefail &&
xcodebuild test -workspace example/ios/Runner.xcworkspace -scheme Runner -destination "platform=iOS Simulator,name=$IOS_SIMULATOR,OS=latest" | xcbeautify
packageFilters:
dirExists:
- 'ios'
- 'example/ios'
# TODO: These packages should probably have platform unit tests
ignore:
- 'datadog_webview_tracking'
- 'datadog_inappwebview_tracking'
unit_test:android:
exec:
concurrency: 1
run: cd example/android && ./gradlew --stacktrace --console=plain test
packageFilters:
dirExists:
- 'android'
- 'example/android'
ignore:
- 'datadog_webview_tracking'
- 'datadog_inappwebview_tracking'
integration_test:ios:
run: melos integration_test:ios:main && melos integration_test:ios:other
integration_test:ios:other:
exec:
concurrency: 1
run: |
mkdir -p $MELOS_ROOT_PATH/.build/test-results
cd example
bash -c 'set -euxo pipefail; \
flutter test integration_test --machine -d iPhone --dart-define DD_CLIENT_TOKEN=$DD_CLIENT_TOKEN,DD_APPLICATION_ID=$DD_APPLICATION_ID \
| tojunit "--output" "$MELOS_ROOT_PATH/.build/test-results/\$MELOS_PACKAGE_NAME_ios_integration.xml"'
packageFilters:
dirExists: 'example/integration_test'
ignore:
- 'datadog_flutter_plugin'
- 'datadog_webview_tracking'
# Because the main package (datadog_flutter_plugin) is set up weird for integration tests,
# have a separate target just for it that is called by `integration_test:ios``
integration_test:ios:main:
exec: |
mkdir -p $MELOS_ROOT_PATH/.build/test-results
cd integration_test_app
bash -c 'set -euxo pipefail; \
flutter test integration_test --machine -d iPhone --dart-define DD_CLIENT_TOKEN=$DD_CLIENT_TOKEN,DD_APPLICATION_ID=$DD_APPLICATION_ID \
| tojunit "--output" "$MELOS_ROOT_PATH/.build/test-results/\$MELOS_PACKAGE_NAME_ios_integration.xml"'
packageFilters:
scope: 'datadog_flutter_plugin'
integration_test:android:
run: melos integration_test:android:main && melos integration_test:android:other
integration_test:android:other:
exec:
concurrency: 1
run: |
mkdir -p $MELOS_ROOT_PATH/.build/test-results
cd example
bash -c 'set -euxo pipefail; \
flutter test integration_test --machine -d emulator --dart-define DD_CLIENT_TOKEN=$DD_CLIENT_TOKEN,DD_APPLICATION_ID=$DD_APPLICATION_ID \
| tojunit "--output" "$MELOS_ROOT_PATH/.build/test-results/\$MELOS_PACKAGE_NAME_android_integration.xml"'
packageFilters:
dirExists: 'example/integration_test'
ignore: 'datadog_flutter_plugin'
# Because the main package (datadog_flutter_plugin) is set up weird for integration tests,
# have a separate target just for it that is called by `integration_test:ios``
integration_test:android:main:
exec: |
mkdir -p $MELOS_ROOT_PATH/.build/test-results
cd integration_test_app
bash -c 'set -euxo pipefail; \
flutter test integration_test --machine -d emulator --dart-define DD_CLIENT_TOKEN=$DD_CLIENT_TOKEN,DD_APPLICATION_ID=$DD_APPLICATION_ID \
| tojunit "--output" "$MELOS_ROOT_PATH/.build/test-results/\$MELOS_PACKAGE_NAME_android_integration.xml"'
packageFilters:
scope: 'datadog_flutter_plugin'
integration_test:web:
run: melos integration_test:web:main && melos integration_test:web:other
integration_test:web:main:
exec: |
cd integration_test_app
dart $MELOS_ROOT_PATH/tools/ci/bin/web_integration_tests.dart
packageFilters:
scope: 'datadog_flutter_plugin'
integration_test:web:other:
exec:
concurrency: 1
run: |
cd example
dart $MELOS_ROOT_PATH/tools/ci/bin/web_integration_tests.dart
packageFilters:
scope: 'datadog_tracking_http_client'
e2e_tests:ios:
exec: |
mkdir -p $MELOS_ROOT_PATH/.build/test-results
cd e2e_test_app
bash -c 'set -euxo pipefail; \
flutter test integration_test --machine -d "iPhone"'
packageFilters:
scope: 'datadog_flutter_plugin'
e2e_tests:android:
exec: |
mkdir -p $MELOS_ROOT_PATH/.build/test-results
cd e2e_test_app
bash -c 'set -euxo pipefail; \
flutter test integration_test --machine -d emulator'
packageFilters:
scope: 'datadog_flutter_plugin'
remove_cocoapods:
exec: |
cd example/ios
pod deintegrate
rm Podfile || true
rm Podfile.lock || true
description: |
Remove Cocoapods support from examples. This prevents some build failures when testing
spm support. This change is permanent and should not be committed to source control.
packageFilters:
dirExists: 'example/ios'
prepare:
run: melos pub:get && melos build_runner && melos generate_env && melos generate_env:e2e
description: |
Run `flutter pub run build_runner build` on all packages and
generate `.env` files for all package examples
pub:get:
exec: flutter pub get
pod_update:
run: cd example/ios && pod update --repo-update
exec:
concurrency: 1
packageFilters:
dirExists: 'example/ios'
build_runner:
exec:
concurrency: 1
run: flutter pub run build_runner build --delete-conflicting-outputs
packageFilters:
dependsOn: build_runner
generate_env:
exec: |
echo "Generating .env"
tee .env > /dev/null << END
# Edit this file with your Datadog client token, environment and application id
DD_CLIENT_TOKEN=$DD_CLIENT_TOKEN
DD_APPLICATION_ID=$DD_APPLICATION_ID
DD_ENV=prod
END
packageFilters:
scope:
- "*example*"
- "*integration_test_app*"
generate_env:e2e:
exec: |
echo "Generating .env"
tee .env > /dev/null << END
# Edit this file with your Datadog client token, environment and application id
DD_CLIENT_TOKEN=$DD_E2E_CLIENT_TOKEN
DD_APPLICATION_ID=$DD_E2E_APPLICATION_ID
DD_E2E_IS_ON_CI=${IS_ON_CI:-false}
DD_ENV=prod
END
packageFilters:
scope:
- "*e2e_test_app*"
pin:ios:
exec:
concurrency: 1
run: dart $MELOS_ROOT_PATH/tools/releaser/bin/pinner.dart --platform ios --package \$MELOS_PACKAGE_PATH
packageFilters:
fileExists: "ios/Podfile"
pin:android:
exec:
concurrency: 1
run: dart $MELOS_ROOT_PATH/tools/releaser/bin/pinner.dart --platform android --package \$MELOS_PACKAGE_PATH
packageFilters:
fileExists: "android/build.gradle"