forked from isar/isar
-
Notifications
You must be signed in to change notification settings - Fork 17
338 lines (322 loc) · 10.8 KB
/
test.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
334
335
336
337
338
name: Dart CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
format:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ secrets.FLUTTER_VERSION }}
- name: Check formatting
run: dart format -o none . --set-exit-if-changed
lint:
name: Check lints
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ secrets.FLUTTER_VERSION }}
- run: dart pub get
working-directory: packages/isar
- run: flutter pub get
working-directory: packages/isar_flutter_libs
- run: flutter pub get
working-directory: packages/isar_inspector
- run: |
flutter pub get
flutter pub run build_runner build
dart tool/generate_all_tests.dart
working-directory: packages/isar_test
- name: Lint
run: flutter analyze
working-directory: packages
test_core:
name: Core Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Run Rust Unit tests
run: cargo test
test:
name: Dart Test
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- run: echo "$OSTYPE"
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
run: sh tool/build.sh
- name: Prepare Tests
run: sh tool/prepare_tests.sh
- name: Run Flutter Unit tests
run: flutter test -j 1
working-directory: packages/isar_test
test_web:
name: Dart Web Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
run: bash tool/build_wasm.sh
- name: Serve isar.wasm
run: npx --yes serve --cors &
- name: Prepare Tests
run: sh tool/prepare_tests.sh
- name: Run Dart Unit tests
run: dart test -p chrome
working-directory: packages/isar_test
coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
run: sh tool/build.sh
- name: Prepare Tests
run: sh tool/prepare_tests.sh
- name: Add packages
run: |
flutter pub add json_annotation
flutter pub add override:file:7.0.0
flutter pub add isar_test --path ../isar_test
working-directory: packages/isar
- name: Collect isar_test Coverage
run: |
flutter test --coverage ../isar_test/test --coverage-path lcov_isar_test.info
working-directory: packages/isar
- name: Collect isar_core Coverage
run: |
cargo install cargo-tarpaulin
cargo tarpaulin -o Lcov --engine llvm
- name: Upload isar_test Coverage
uses: codecov/codecov-action@v3
with:
files: packages/isar/lcov_isar_test.info
flags: isar
- name: Upload isar_core Coverage
uses: codecov/codecov-action@v3
with:
files: lcov.info
flags: core
test_generator:
name: Generator Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
- name: Run Generator Unit tests
run: |
dart pub get
dart test
working-directory: packages/isar
integration_test_ios:
name: Integration Test iOS
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- name: Start simulator
uses: futureware-tech/simulator-action@v2
with:
model: iPhone 14
- uses: subosito/flutter-action@v2
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
run: |
bash tool/build_ios.sh
unzip isar_ios.xcframework.zip -d packages/isar_flutter_libs/ios
- name: Prepare Tests
run: sh tool/prepare_tests.sh
- name: Run Flutter Integration tests
run: flutter test integration_test.dart --dart-define STRESS=true
working-directory: packages/isar_test
integration_test_android:
name: Integration Test Android
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: "11"
distribution: "zulu"
- uses: subosito/flutter-action@v2
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
run: |
bash tool/build_android.sh x64
mkdir -p packages/isar_flutter_libs/android/src/main/jniLibs/x86_64
mv libisar_android_x64.so packages/isar_flutter_libs/android/src/main/jniLibs/x86_64/libisar.so
- name: Prepare Tests
run: sh tool/prepare_tests.sh
- name: Run Flutter Integration tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
arch: x86_64
profile: pixel
working-directory: packages/isar_test
script: flutter test integration_test.dart --dart-define STRESS=true
integration_test_macos:
name: Integration Test macOS
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
run: |
bash tool/build_macos.sh
install_name_tool -id @rpath/libisar.dylib libisar_macos.dylib
mv libisar_macos.dylib packages/isar_flutter_libs/macos/libisar.dylib
- name: Prepare Tests
run: sh tool/prepare_tests.sh
- name: Run Flutter Driver tests
run: |
flutter config --enable-macos-desktop
flutter test -d macos integration_test.dart --dart-define STRESS=true
working-directory: packages/isar_test
integration_test_linux:
name: Integration Test Linux
if: ${{ false }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Install Linux requirements
run: sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-de
- name: Setup headless display
uses: pyvista/setup-headless-display-action@v1
- name: Build Isar Core
run: |
bash tool/build_linux.sh x64
mv libisar_linux_x64.so packages/isar_flutter_libs/linux/libisar.so
- name: Prepare Tests
run: sh tool/prepare_tests.sh
- name: Run Flutter Driver tests
run: |
flutter config --enable-linux-desktop
flutter test -d linux integration_test.dart --dart-define STRESS=true
working-directory: packages/isar_test
integration_test_windows:
name: Integration Test Windows
runs-on: windows-2019
if: ${{ false }}
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
run: |
bash tool/build_windows.sh x64
mv isar_windows_x64.dll packages/isar_flutter_libs/windows/libisar.dll
- name: Prepare Tests
run: sh tool/prepare_tests.sh
- name: Run Flutter Driver tests
run: |
flutter config --enable-windows-desktop
flutter test -d windows integration_test.dart --dart-define STRESS=true
working-directory: packages/isar_test
integration_test_chrome:
name: Integration Test Chrome
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
run: bash tool/build_wasm.sh
- name: Serve isar.wasm
run: npx --yes serve --cors &
- name: Install chromedricer
uses: nanasess/setup-chromedriver@v2
- name: Prepare chromedricer
run: chromedriver --port=4444 &
- name: Run Dart tests in browser
run: |
flutter pub get
dart tool/generate_long_double_test.dart
dart tool/generate_all_tests.dart
flutter pub run build_runner build
flutter drive --driver=integration_driver.dart --target=integration_test.dart -d web-server --browser-name chrome
working-directory: packages/isar_test
integration_test_safari:
name: Integration Test Safari
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
run: |
brew install llvm
bash tool/build_wasm.sh
- name: Serve isar.wasm
run: npx --yes serve --cors &
- name: Prepare safaridricer
run: |
sudo safaridriver --enable
safaridriver --port=4444 &
- name: Run Dart tests in browser
run: |
flutter pub get
dart tool/generate_long_double_test.dart
flutter pub run build_runner build
dart tool/generate_all_tests.dart
flutter drive --driver=integration_driver.dart --target=integration_test.dart -d web-server --browser-name safari
working-directory: packages/isar_test
integration_test_firefox:
name: Integration Test Firefox
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
- name: Prepare Build
uses: ./.github/actions/prepare-build
- name: Build Isar Core
run: bash tool/build_wasm.sh
- name: Serve isar.wasm
run: npx --yes serve --cors &
- name: Install geckodriver
uses: browser-actions/setup-geckodriver@latest
- name: Prepare geckodriver
run: geckodriver --port=4444 &
- name: Run Dart tests in browser
run: |
flutter pub get
dart tool/generate_long_double_test.dart
flutter pub run build_runner build
dart tool/generate_all_tests.dart
flutter drive --driver=integration_driver.dart --target=integration_test.dart -d web-server --browser-name firefox
working-directory: packages/isar_test