forked from cfug/dio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
melos.yaml
165 lines (158 loc) · 4.66 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
name: dio_workspace
repository: https://github.com/cfug/dio
packages:
- 'dio'
- 'plugins/*'
- 'plugins/**/example*'
- 'example*'
- 'dio_test'
ide:
intellij:
enabled: true
moduleNamePrefix: ''
command:
bootstrap:
runPubGetInParallel: false
clean:
hooks:
post: |
# Clean all flutter projects
melos exec --flutter -- "flutter clean"
# Clean coverage files
rm -rf coverage
rm -rf pubspec.lock
melos exec --dir-exists coverage -- "rm -rf coverage"
scripts:
analyze:
description: Analyze all packages
exec: dart analyze --fatal-infos
format:
description: Format check all packages
exec: dart format --set-exit-if-changed .
format:fix:
description: Format all packages
exec: dart format .
publish-dry-run:
description: Publish dry-run all packages
exec: dart pub publish --dry-run
packageFilters:
noPrivate: true
httpbun:local:
description: Run httpbun locally
run: echo "const httpbunBaseUrl = 'https://httpbun.local';" > dio_test/lib/src/httpbun.dart
httpbun:com:
description: Run httpbun locally
run: echo "const httpbunBaseUrl = 'https://httpbun.com';" > dio_test/lib/src/httpbun.dart
test:
name: All tests
run: |
melos run test:vm
TEST_PLATFORM=chrome melos run test:web
TEST_PLATFORM=firefox melos run test:web
melos run test:flutter
test:vm:
name: Dart VM tests
exec: |
if [ "$TARGET_DART_SDK" = "min" ]; then
dart test --preset=${TEST_PRESET:-default},${TARGET_DART_SDK:-stable} --chain-stack-traces
else
dart test --preset=${TEST_PRESET:-default},${TARGET_DART_SDK:-stable} --coverage=coverage/vm --chain-stack-traces
fi
packageFilters:
flutter: false
dirExists: test
fileExists: .melos_package
ignore:
- 'dio_web_adapter'
test:web:
name: Dart Web tests
run: |
melos run test:web:chrome
melos run test:web:firefox
test:web:chrome:
name: Dart Web tests in chrome
run: melos run test:web:single
env:
TEST_PLATFORM: chrome
WITH_WASM: true
test:web:firefox:
name: Dart Web tests in firefox
run: melos run test:web:single
env:
TEST_PLATFORM: firefox
WITH_WASM: false
test:web:single:
name: Dart Web tests in a browser
exec: |
if [ "$TARGET_DART_SDK" = "min" ]; then
dart test --platform ${TEST_PLATFORM} --preset=${TEST_PRESET:-default},${TARGET_DART_SDK:-stable} --chain-stack-traces
else
dart test --platform ${TEST_PLATFORM} --coverage=coverage/${TEST_PLATFORM} --preset=${TEST_PRESET:-default},${TARGET_DART_SDK:-stable} --chain-stack-traces
if [ "$WITH_WASM" = "true" ]; then
dart test --platform ${TEST_PLATFORM} --coverage=coverage/${TEST_PLATFORM} --preset=${TEST_PRESET:-default},${TARGET_DART_SDK:-stable} --chain-stack-traces --compiler=dart2wasm
fi
fi
packageFilters:
flutter: false
dirExists: test
fileExists: .melos_package
ignore:
- '*http2*'
- '*cookie*'
test:flutter:
name: Flutter tests
exec: flutter test --coverage
packageFilters:
flutter: true
dirExists: test
fileExists: .melos_package
ignore:
- '*example*'
test:coverage:
name: Run all tests and display coverage
run: |
melos run test
melos run coverage:format
melos run coverage:show
upgrade:dart:
name: Upgrade Dart package deps
exec: dart pub upgrade
packageFilters:
flutter: false
upgrade:flutter:
name: Upgrade Flutter package deps
exec: flutter pub upgrade
packageFilters:
flutter: true
build:example:apk:
run: |
cd example_flutter_app
flutter build apk --debug
coverage:clean:
name: Clear coverage
exec: rm -rf coverage
coverage:format:
name: Format coverage
run: |
dart pub global activate coverage
melos run coverage:format:package
coverage:format:package:
name: Format coverage for each package
exec: dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --report-on=lib
packageFilters:
flutter: false
dirExists: coverage
coverage:combine:
name: Combine & convert coverage report
run: |
rm -rf coverage
dart pub global activate combine_coverage
dart pub global activate cobertura
melos run coverage:format
dart pub global run combine_coverage --repo-path=$pwd
dart pub global run cobertura convert --pubspec dio/pubspec.yaml
coverage:show:
name: Show coverage report
run: |
melos run coverage:combine
dart pub global run cobertura show