-
Notifications
You must be signed in to change notification settings - Fork 4k
/
melos.yaml
333 lines (301 loc) · 10.9 KB
/
melos.yaml
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
327
328
329
330
331
332
333
name: FlutterFire
repository: https://github.com/firebase/flutterfire
packages:
- packages/*
- packages/*/*
- packages/*/*/*
- tests
command:
version:
# Generate commit links in package changelogs.
linkToCommits: true
# # Only allow versioning to happen on main branch.
# branch: main
# Additionally build a changelog at the root of the workspace.
workspaceChangelog: true
hooks:
preCommit: |
dart run scripts/generate_vertexai_version.dart && \
dart run scripts/generate_dataconnect_version.dart && \
git add packages/firebase_vertexai/firebase_vertexai/lib/src/vertex_version.dart && \
git add packages/firebase_data_connect/firebase_data_connect/lib/src/dataconnect_version.dart
post: |
dart run scripts/generate_tag_spm_firebase_core.dart
bootstrap:
# It seems so that running "pub get" in parallel has some issues (like
# https://github.com/dart-lang/pub/issues/3404). Disabling this feature
# makes the CI much more stable.
runPubGetInParallel: false
usePubspecOverrides: true
scripts:
lint:all:
run: melos run analyze-ci && melos run format-ci
description: Run all static analysis checks.
analyze-ci:
# We are setting the concurrency to 1 because a higher concurrency can crash
# the analysis server on low performance machines (like GitHub Actions).
run: |
melos exec -c 1 -- \
dart analyze . --fatal-infos
description: |
Run `dart analyze` in all packages.
- Note: you can also rely on your IDEs Dart Analysis / Issues window.
firebase:emulator:
run: |
cd .github/workflows/scripts && ./start-firebase-emulator.sh
description: |
Start the Firebase emulator suite. Used by Functions, Firestore, Auth and Storage
integration testing.
- Requires Node.js and NPM installed.
format-ci:
run: |
dart pub global run flutter_plugin_tools format && \
swiftformat .
description: |
Formats the code of all packages (Java, Objective-C, and Dart).
- Requires `flutter_plugin_tools` (`pub global activate flutter_plugin_tools`).
- Requires `git`.
- Requires `clang-format` (can be installed via Brew on MacOS).
- Requires `swiftformat` (can be installed via Brew on macOS).
build:all:
run: |
melos run build:example_ios_pub --no-select && \
melos run build:example_android_pub --no-select && \
melos run build:example_macos --no-select
description: Build all example apps.
build:example_android:
run: |
melos exec -c 6 --fail-fast -- \
"flutter build apk"
description: Build a specific example app for Android.
packageFilters:
dirExists:
- android
scope: '*example*'
build:example_android_pub:
run: |
melos exec -c 6 --fail-fast -- \
"flutter build apk"
description: Build a specific example app for Android.
packageFilters:
dirExists:
- android
scope: '*example*'
build:example_ios:
run: |
melos exec -c 6 --fail-fast -- \
"flutter build ios --no-codesign"
description: Build a specific example app for iOS.
packageFilters:
dirExists:
- ios
scope: '*example*'
build:example_ios_pub:
run: |
melos exec -c 6 --fail-fast -- \
"flutter build ios --no-codesign"
description: Build a specific example app for iOS.
packageFilters:
dirExists:
- ios
scope: '*example*'
build:example_macos:
run: |
melos exec -c 6 --fail-fast -- \
"flutter build macos"
description: |
Build a specific example app for macOS.
packageFilters:
dirExists:
- macos
scope: '*example*'
test:all:
run: |
melos run test --no-select && \
melos run test:web --no-select && \
melos run test:e2e --no-select
description: |
Run all tests available.
test:
run: |
melos exec -c 6 --fail-fast -- \
"flutter test"
description: Run `flutter test` for a specific package.
packageFilters:
dirExists:
- test
ignore:
- '*web*'
- '*example*'
test:web:
run: |
melos exec -c 1 --fail-fast -- \
"flutter test --platform=chrome"
description: Run `flutter test --platform=chrome` for a specific '*web' package.
packageFilters:
dirExists:
- test
scope: '*web*'
test:e2e:
run: |
melos exec -c 1 --fail-fast -- \
"flutter test integration_test/e2e_test.dart"
description: |
Run all e2e tests.
packageFilters:
dirExists:
- integration_test
scope: '*tests*'
test:e2e:cloud_firestore:
run: |
cd packages/cloud_firestore/cloud_firestore/example
flutter test integration_test/e2e_test.dart
description: |
Run all e2e tests for cloud_firestore.
test:e2e:firebase_performance:
run: |
cd packages/firebase_performance/firebase_performance/example
flutter test integration_test/firebase_performance_e2e_test.dart
description: |
Run all e2e tests for firebase_performance.
test:e2e:web:
run: |
melos exec -c 1 --fail-fast -- \
"flutter drive --target=./integration_test/e2e_test.dart --driver=./test_driver/integration_test.dart -d chrome --dart-define=APP_CHECK_E2E=true"
description: |
Run all e2e tests on web platform. Please ensure you have "chromedriver" installed and running.
packageFilters:
dirExists:
- test_driver
scope: '*tests*'
test:e2e:web:cloud_firestore:
run: |
cd packages/cloud_firestore/cloud_firestore/example
flutter drive --target=./integration_test/e2e_test.dart --driver=./test_driver/integration_test.dart -d chrome
description: |
Run all e2e tests for cloud_firestore on web platform. Please ensure you have "chromedriver" installed and running.
test:e2e:web:firebase_performance:
run: |
cd packages/firebase_performance/firebase_performance/example
flutter drive --target=./integration_test/firebase_performance_e2e_test.dart --driver=./test_driver/integration_test.dart --release -d chrome
description: |
Run all e2e tests for firebase_performance on web platform. Please ensure you have "chromedriver" installed and running.
clean:deep:
run: git clean -x -d -f -q
description: Clean things very deeply, can be used to establish "pristine checkout" status.
test:e2e:windows:
run: |
melos exec -c 1 --fail-fast -- \
"flutter test integration_test/e2e_test.dart -d windows"
description: |
Run all e2e tests.
packageFilters:
dirExists:
- integration_test
scope: '*tests*'
qualitycheck:
run: |
melos run clean:deep && \
melos clean && \
melos bootstrap && \
melos run lint:all && \
melos run build:all && \
melos run test:all
description: Run all targets generally expected in CI for a full local quality check.
generate:pigeon:
run: |
melos exec -- "flutter pub run pigeon --input ./pigeons/messages.dart" && \
melos run generate:pigeon:macos --no-select && \
melos run generate:pigeon:android --no-select && \
melos run format-ci --no-select
packageFilters:
fileExists: 'pigeons/messages.dart'
description: Generate the pigeon messages for all the supported packages.
generate:pigeon:macos:
run: |
melos exec -- "sed -i '' 's;#import <Flutter/Flutter.h>;#if TARGET_OS_OSX\n#import <FlutterMacOS/FlutterMacOS.h>\n#else\n#import <Flutter/Flutter.h>\n#endif;g' ios/Classes/messages.g.m"
packageFilters:
fileExists: 'ios/Classes/messages.g.m'
description: Pigeon does not add the condition to import Flutter or FlutterMacOs. Add the condition
generate:pigeon:android:
run: |
melos exec -- "find ./android -type f -name '*Generated*' | xargs sed -i '.bak' 's/ArrayList<Object> toList() {/public ArrayList<Object> toList() {/g'" && \
melos exec -- "find ./android -type f -name '*.bak' -delete"
packageFilters:
dirExists: 'android'
description: Transform the method toList() into a public one to be used in EventChannel
# Additional cleanup lifecycle script, executed when `melos clean` is run.
postclean: >
melos exec -c 6 -- "flutter clean"
add-license-header:
# If you add here another --ignore flag, add it also to
# "check-license-header".
run: |
addlicense -f header_template.txt \
--ignore "**/*.yml" \
--ignore "**/*.yaml" \
--ignore "**/*.xml" \
--ignore "**/*.g.dart" \
--ignore "**/*.sh" \
--ignore "**/*.html" \
--ignore "**/*.js" \
--ignore "**/*.ts" \
--ignore "**/*.g.h" \
--ignore "**/*.g.m" \
--ignore "**/*.rb" \
--ignore "**/*.txt" \
--ignore "**/*.cmake" \
--ignore "**/Runner/AppDelegate.swift" \
--ignore "**/Runner/MainFlutterWindow.swift" \
--ignore "**/Runner/Runner-Bridging-Header.h" \
--ignore "**/Runner/AppDelegate.h" \
--ignore "**/Runner/AppDelegate.m" \
--ignore "**/Runner/main.m" \
--ignore "**/MainActivity.kt" \
--ignore "**/MainActivity.java" \
--ignore "**/FlutterMultiDexApplication.java" \
--ignore "**/GeneratedPluginRegistrant.swift" \
--ignore "**/Pods/**" \
--ignore "**/generated/**" \
--ignore "**/flutter/generated_plugin_registrant.h" \
--ignore "**/flutter/generated_plugin_registrant.cc" \
.
description: Add a license header to all necessary files.
check-license-header:
# If you add here another --ignore flag, add it also to
# "add-license-header".
run: |
addlicense -f header_template.txt \
--check \
--ignore "**/*.yml" \
--ignore "**/*.yaml" \
--ignore "**/*.xml" \
--ignore "**/*.g.dart" \
--ignore "**/*.sh" \
--ignore "**/*.html" \
--ignore "**/*.js" \
--ignore "**/*.ts" \
--ignore "**/*.g.h" \
--ignore "**/*.g.m" \
--ignore "**/*.rb" \
--ignore "**/*.txt" \
--ignore "**/*.cmake" \
--ignore "**/Runner/AppDelegate.swift" \
--ignore "**/Runner/MainFlutterWindow.swift" \
--ignore "**/Runner/Runner-Bridging-Header.h" \
--ignore "**/Runner/AppDelegate.h" \
--ignore "**/Runner/AppDelegate.m" \
--ignore "**/Runner/main.m" \
--ignore "**/MainActivity.kt" \
--ignore "**/MainActivity.java" \
--ignore "**/FlutterMultiDexApplication.java" \
--ignore "**/GeneratedPluginRegistrant.swift" \
--ignore "**/Pods/**" \
--ignore "**/generated/**" \
--ignore "**/flutter/generated_plugin_registrant.h" \
--ignore "**/flutter/generated_plugin_registrant.cc" \
.
description: Add a license header to all necessary files.
bom:
run: dart scripts/generate_bom.dart
description: Generate a Bill of Materials (BOM) file for all packages.