-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
872 lines (763 loc) · 23.9 KB
/
main.yml
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
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [master]
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# https://stackoverflow.com/a/72408109/3443137
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
# For a lower total time
# the jobs which take longes must come before the faster ones
# because github will start them likely earlier
jobs:
core:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set node version
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: log versions
run: |
node --version
npm -v
- name: Reuse npm cache folder
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-core-x3-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-core-x3-
- name: install npm dependencies
run: npm install
- name: build
run: npm run build
- name: test:typings
run: npm run test:typings
# We have to run all major scripts once on windows to ensure windows-devs can
# run the test suite.
windows:
runs-on: windows-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set node version
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: log versions
run: |
node --version
npm -v
- name: Reuse npm cache folder
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-windows-x3-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-windows-x3-
- name: install npm dependencies
run: npm install
- run: npm run build && cat ./test_tmp/package.json
- run: npm run test:node:memory
storage-dexie:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set node version
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Reuse npm cache folder
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-storage-dexie-x3-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-storage-dexie-x3-
- name: install npm dependencies
run: npm install
- name: build
run: npm run build
- run: npm run test:node:dexie
- run: npm run test:fast:dexie
- name: npm run test:browser:dexie
uses: coactions/setup-xvfb@v1
with:
run: npm run test:browser:dexie
- name: performance test
uses: coactions/setup-xvfb@v1
with:
run: npm run test:performance:dexie
storage-memory:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set node version
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Reuse npm cache folder
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-memory-x3-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-memory-x3-
- run: npm install
- run: npm run build
- run: npm run test:node:memory
- run: npm run test:fast:memory
- name: npm run test:browser:memory
uses: coactions/setup-xvfb@v1
with:
run: npm run test:browser:memory
- run: npm run test:fast:memory-random-delay
- name: performance test
uses: coactions/setup-xvfb@v1
with:
run: npm run test:performance:memory:browser
- run: npm run test:performance:memory:node
- name: node example
working-directory: ./examples/node
run: |
npm install
npm run test
storage-remote:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set node version
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Reuse npm cache folder
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-remote-x3-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-remote-x3-
- name: install npm dependencies
run: npm install
- name: build
run: npm run build
- run: npm run test:node:remote
- name: npm run test:browser:remote
uses: coactions/setup-xvfb@v1
with:
run: npm run test:browser:remote
storage-foundationdb:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set node version
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Reuse npm cache folder and docker layers
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
/tmp/.buildx-cache
key: ${{ runner.os }}-npm-storage-foundationdb-x3-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-storage-foundationdb-x3-
- name: pre-pull foundationdb docker images
# ensure it has downloaded the image
run: |
docker pull foundationdb/foundationdb:7.3.23
- name: install FoundationDB client and server
working-directory: ./scripts
run: sh install-foundationdb.sh
- name: install npm dependencies
run: npm install
- run: npm install [email protected]
- name: build
run: npm run build
# Run them twice to ensure no test has persistence
- run: npm run test:node:foundationdb
- run: npm run test:node:foundationdb
- run: npm run test:fast:foundationdb
- run: npm run test:performance:foundationdb
storage-mongodb:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set node version
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Reuse npm cache folder
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-storage-mongodb-x3-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-storage-mongodb-x3-
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: 7.0.1
- name: install npm dependencies
run: npm install
- run: npm run build
- run: node ./config/mongodb-connection-tester.js
- run: npm run test:node:mongodb
- run: npm run test:fast:mongodb
- run: npm run test:performance:mongodb
example-angular:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
#- name: install dependencies
# run: sudo apt-get update && sudo apt-get install -y chromium-browser
- name: Set node version
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Reuse npm cache folder
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
./examples/angular/node_modules
# invalidate cache when any package.json changes
key: ${{ runner.os }}-npm-angular-x3-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-angular-x3-
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
rm -r node_modules
- name: angular build
working-directory: ./examples/angular
run: |
npm run preinstall
npm install --legacy-peer-deps
npm run lint
npm run build
- name: angular test
# uses: DevExpress/testcafe-action@latest
uses: coactions/setup-xvfb@v1
with:
working-directory: ./examples/angular
run: npm run test:build
# - name: angular test ssr
# working-directory: ./examples/angular
# run: npm run test:ssr
- name: Capacitor build
working-directory: ./examples/angular
run: npm run build:capacitor
test-builds:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set node version
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Reuse npm cache folder
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
./docs-src/node_modules
key: ${{ runner.os }}-npm-test-builds-x3-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-test-builds-x3-
- name: prepare RxDB core
run: |
npm install
npm run build
- name: measure build size
run: npm run build:size
- run: npm run build:rollup
- name: test docs build
run: |
npm -v
(cd docs-src && npm install)
npm run docs:build
test-code-style:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set node version
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Reuse npm cache folder
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-test-code-style-x3-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-test-code-style-x3-
- name: spelling readme
uses: codespell-project/[email protected]
with:
ignore_words_file: config/codespellignore.txt
path: README.md
- name: spelling src
uses: codespell-project/[email protected]
with:
ignore_words_file: config/codespellignore.txt
path: src
- name: spelling docs-src
uses: codespell-project/[email protected]
with:
ignore_words_file: config/codespellignore.txt
skip: legal-notice.tsx
path: docs-src
- name: spelling docs-src/releases
uses: codespell-project/[email protected]
with:
ignore_words_file: config/codespellignore.txt
path: docs-src/releases
- name: spelling test
uses: codespell-project/[email protected]
with:
ignore_words_file: config/codespellignore.txt
path: test
- name: prepare RxDB core
run: |
npm install
npm run build
- name: test:deps
run: npm run test:deps
- name: test:circular
run: npm run test:circular
- name: lint
run: npm run lint
- name: check types
run: npm run check-types
example-electron:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set node version
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y chromium-browser
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
- name: electron install
working-directory: ./examples/electron
run: |
npm run preinstall
npm install --legacy-peer-deps
- name: electron test
uses: coactions/setup-xvfb@v1
with:
working-directory: ./examples/electron
run: npm run test
example-react:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set node version
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y chromium-browser
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
rm -r node_modules
- name: react install
working-directory: ./examples/react
run: |
npm run preinstall
npm install --legacy-peer-deps
npm run build
- name: react test
uses: coactions/setup-xvfb@v1
with:
working-directory: ./examples/react
run: npm run test:build
example-react-native-expo:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set node version
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
rm -rf node_modules
- name: react-native test dev
run: |
cd ./examples/react-native
npm run preinstall
npm i install --legacy-peer-deps
npm run test
- name: react-native test bundle
run: |
cd ./examples/react-native
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
npm run test:bundle
example-supabase:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set node version
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Reuse npm cache folder
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
./examples/supabase/node_modules
# invalidate cache when any package-lock.json changes
key: ${{ runner.os }}-npm-supabase-x3-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-supabase-x3
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-supabase-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
rm -r node_modules
- name: Install
working-directory: ./examples/supabase
run: |
npm run preinstall
npm install --legacy-peer-deps
- name: start supabase
working-directory: ./examples/supabase
run: npm run supabase:start
- name: build
working-directory: ./examples/supabase
run: npm run build
# TODO these tests randomly fail. Never because of RxDB
# but always because random supabase updates because the
# supabase build is not deterministic.
# - name: test
# uses: coactions/setup-xvfb@v1
# with:
# working-directory: ./examples/supabase
# run: npm run test:dexie
example-vue:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y chromium-browser
- name: Set node version
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
rm -r node_modules
- name: vue build
working-directory: ./examples/vue
run: |
npm run preinstall
npm install --legacy-peer-deps
npm run lint
npm run build
- name: vue test
uses: coactions/setup-xvfb@v1
with:
working-directory: ./examples/vue
run: npm run test
example-svelte:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y chromium-browser
- name: Set node version
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
rm -r node_modules
- name: svelte build
working-directory: ./examples/svelte
run: |
npm run preinstall
npm install --legacy-peer-deps
npm run build
- name: svelte test
uses: coactions/setup-xvfb@v1
with:
working-directory: ./examples/svelte
run: npm run test
vite-vanilla-ts:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y chromium-browser
- name: Set node version
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
rm -r node_modules
- name: vite vanilla ts build
working-directory: ./examples/vite-vanilla-ts
run: |
npm run preinstall
npm install --legacy-peer-deps
npm run build
- name: vite vanilla ts test
uses: coactions/setup-xvfb@v1
with:
working-directory: ./examples/vite-vanilla-ts
run: npm run test
example-graphql:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y chromium-browser
- name: Set node version
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
- name: install
working-directory: ./examples/graphql
run: |
npm run preinstall
npm install --legacy-peer-deps
- name: build
working-directory: ./examples/graphql
run: npm run build
- name: test test:dexie
uses: coactions/setup-xvfb@v1
with:
working-directory: ./examples/graphql
run: npm run test:dexie
# example-flutter:
# runs-on: ubuntu-22.04
# timeout-minutes: 30
# steps:
# - uses: actions/checkout@v4
# - name: Set node version
# uses: actions/setup-node@v4
# with:
# node-version-file: ".nvmrc"
# - uses: subosito/flutter-action@v2
# with:
# flutter-version: "3.3.4"
# channel: "stable"
# - run: flutter --version
# - name: Reuse npm cache folder
# uses: actions/cache@v4
# env:
# cache-name: cache-node-modules
# with:
# path: |
# ~/.npm
# ./node_modules
# ./examples/flutter/javascript/node_modules
# key: ${{ runner.os }}-npm-flutter-x3-${{ hashFiles('**/package.json') }}
# restore-keys: |
# ${{ runner.os }}-npm-flutter-x3-
# - name: prepare RxDB core
# run: |
# npm install --legacy-peer-deps
# npm run build
# rm -r node_modules
# - name: flutter javascript build
# working-directory: ./examples/flutter/javascript
# run: |
# npm run preinstall
# npm install --legacy-peer-deps
# npm run build
# - name: Add flutter linux dependencies
# run: |
# sudo apt-get update -y
# sudo apt-get install -y ninja-build libgtk-3-dev
# - name: flutter test
# uses: coactions/setup-xvfb@v1
# with:
# working-directory: ./examples/flutter
# run: |
# flutter config --enable-linux-desktop
# flutter test integration_test/basics_test.dart -d linux
test-tutorials:
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set node version
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: prepare RxDB core
run: |
npm install
npm run build
- name: test tutorials
working-directory: ./test/tutorials/
run: |
npm install
npm test
test-others:
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Set node version
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Reuse npm cache folder
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
key: ${{ runner.os }}-npm-others-x3-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-others-x3-
- name: prepare RxDB core
run: |
npm install
npm run build
- run: npm run test:replication-couchdb
- name: firestore replication
run: |
timeout 1h bash -c 'until npm run test:replication-firestore; do sleep 15; done'
- name: nats replication
# first start/stop the container once to ensure it
# has downloaded the image
run: |
docker pull nats:2.9.17
npm run test:replication-nats
# bun
- uses: oven-sh/setup-bun@v2
with:
bun-version: '1.1.18'
- run: npm run test:bun:dexie
- run: npm run test:performance:memory:bun
# deno (must be last because it messes up with file permissions)
- name: Reuse deno cache folder
uses: actions/cache@v4
env:
cache-name: cache-deno-modules
with:
path: |
/home/runner/.cache/deno
# do not cache based on package.json because deno install randomly fails
# and it would then never succeed on the first run on dependency updateds
key: ${{ runner.os }}-deno-x3-
- name: clear denoKV storage files
run: rm -rf /home/runner/.cache/deno/location_data/*
- uses: denoland/setup-deno@v1
with:
# https://github.com/denoland/deno/releases
deno-version: "1.46.3"
- name: run deno tests:dexie
run: |
sudo npm i -g cross-env
deno info
timeout 1h bash -c 'until npm run test:deno:dexie; do sleep 5; done'
- name: run deno tests:denokv
run: |
sudo npm i -g cross-env
deno info
timeout 1h bash -c 'until npm run test:deno:denokv; do sleep 5; done'
# TODO fix deno performance test
#- run: npm run test:performance:memory:deno