-
Notifications
You must be signed in to change notification settings - Fork 90
/
Copy pathmelos.yaml
225 lines (194 loc) · 6.18 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
name: realm-dart
repository: https://github.com/realm/realm-dart
ide:
intellij: # no one uses android studio right?
enabled: false
packages:
- packages/*
- packages/*/example
- packages/*/tests
command:
bootstrap:
environment:
sdk: ^3.3.0
flutter: ^3.19.0
dev_dependencies:
lints: ^3.0.0
clean:
hooks:
pre: melos exec --flutter -- flutter clean
scripts:
setup:
steps:
- dart pub global activate combine_coverage
- dart pub global activate coverage
- dart pub global activate coverde
- dart pub global activate dependency_validator
- dart pub global activate ffigen
- dart pub global activate melos
- dart pub global activate pana
- dart pub global activate --source path $MELOS_ROOT_PATH/packages/realm_dart/dev/
build:
steps:
- build:native
- build:binding
- build:dart
build:native:
exec: dev build
packageFilters:
dirExists: src # by convention
build:dart:
run: dart run build_runner build --delete-conflicting-outputs
exec:
concurrency: 1 # only one project at a time to keep output sane
packageFilters:
dependsOn: build_runner
build:binding:
exec: dart run ffigen --config ffigen.yaml
packageFilters:
fileExists: ffigen.yaml # by convention
dependsOn: ffigen
test:
description: Run all tests.
steps:
- test:unit
- test:widget
- test:lints
- test:integration
test:unit:
run: dart test --concurrency=1 --coverage=coverage/ --file-reporter=json:test-results.json --reporter=github
exec:
concurrency: 1 # only one project at a time to keep output sane
packageFilters:
dependsOn: test
dirExists: test/
flutter: false
test:widget:
run: flutter test --concurrency=1 --coverage --reporter=github
exec:
concurrency: 1 # only one project at a time to keep output sane
packageFilters:
dependsOn: flutter_test
noDependsOn: integration_test # integration tests are run separately
dirExists: test/
flutter: true
test:lints:
run: dart run custom_lint
exec:
concurrency: 1 # only one project at a time to keep output sane
packageFilters:
dependsOn: custom_lint
test:integration:
run: >-
flutter test integration_test/all_tests.dart
--coverage
--dart-define=BAAS_URL='$BAAS_URL'
--dart-define=BAAS_DIFFERENTIATOR='$BAAS_DIFFERENTIATOR'
--device-id='$DEVICE_ID'
--file-reporter=json:test-results.json
--reporter=github
--suppress-analytics
exec:
concurrency: 1 # only one project at a time to keep output sane
packageFilters:
dependsOn: integration_test
fileExists: integration_test/all_tests.dart
flutter: true
doc:
description: Generate documentation.
exec: dart doc --validate-links
packageFilters:
published: true
custom_format:
description: Format code.
# while we wait for https://github.com/dart-lang/dart_style/issues/864
run: >-
find lib test integration_test -name '*.dart' -not -name '*.g.dart' -not -name '*.realm.dart' -not -name 'realm_bindings.dart' 2> /dev/null
| xargs dart format --fix --line-length 160
exec:
concurrency: 1 # only one project at a time to keep output sane
upgrade:
description: Upgrade all dependencies.
exec: dart pub upgrade --major-versions
lint:
description: Run all lints.
steps:
- lint:format
- lint:pana
- melos publish --dry-run
lint:deps:
exec: dependency_validator
lint:format:
# while we wait for https://github.com/dart-lang/dart_style/issues/864
run: >-
find lib test integration_test -name '*.dart' -not -name '*.g.dart' -not -name '*.realm.dart' -not -name 'realm_bindings.dart' 2> /dev/null
| xargs dart format --fix --line-length 160 --output none --set-exit-if-changed
exec:
concurrency: 1 # only one project at a time to keep output sane
lint:pana:
run: pana --no-warning --exit-code-threshold 40 .
exec:
concurrency: 1 # only one project at a time to keep output sane
packageFilters:
published: true
coverage:
description: Generate, check and render coverage.
steps:
- coverage:convert
- coverage:gather
- coverage:groom
- coverage:report
- coverage:check
coverage:check: # TODO: Increase to 90 eventually
run: coverde check 80
exec:
concurrency: 1 # only one project at a time to keep output sane
packageFilters:
fileExists: coverage/lcov.info # by convention
coverage:convert:
run: format_coverage --packages=.dart_tool/package_config.json --report-on=lib/ --in=coverage/test/ --lcov --out=coverage/lcov.info
exec:
concurrency: 1 # only one project at a time to keep output sane
packageFilters:
dependsOn: test
dirExists: coverage/test/
flutter: false
coverage:gather:
run: |
rm -rf $MELOS_ROOT_PATH/coverage
combine_coverage --repo-path=$MELOS_ROOT_PATH
coverage:groom:
run: |
lcov --remove coverage/lcov.info '*/lib/src/cli/*' -o coverage/lcov.info
lcov --remove coverage/lcov.info '*/realm_bindings.dart' -o coverage/lcov.info
coverage:report:
run: coverde report
update:version:
steps:
- update:version:ejson
- update:version:realm
update:version:ejson:
description: Update version of all ejson packages collectively
run: >-
melos version --no-git-commit-version --no-changelog --no-dependent-versions --yes
-V ejson_analyzer:$EJSON_VERSION
-V ejson_annotation:$EJSON_VERSION
-V ejson_generator:$EJSON_VERSION
-V ejson_lint:$EJSON_VERSION
-V ejson:$EJSON_VERSION
update:version:realm:
description: Update version of all realm packages collectively
run: >-
melos version --no-git-commit-version --no-changelog --no-dependent-versions --yes
-V realm_common:$REALM_VERSION
-V realm_dart:$REALM_VERSION
-V realm_generator:$REALM_VERSION
-V realm:$REALM_VERSION
# TODO: This is actually stricter than on CI, but we should aim for this
ci:
steps:
- build
- test
- coverage
- analyze
- lint