-
Notifications
You must be signed in to change notification settings - Fork 6
940 lines (810 loc) · 31.2 KB
/
analysis-coverage.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
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
name: Analysis & Coverage
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
concurrency:
group: ana_cov-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
NEXTCLOUD_URL: "http://localhost:8080"
APP_ID: "nc_py_api"
APP_VERSION: "1.0.0"
APP_SECRET: "tC6vkwPhcppjMykD1r0n9NlI95uJMBYjs5blpIcA1PAdoPDmc5qoAjaBAkyocZ6E"
APP_PORT: 9009
NC_AUTH_USER: "admin"
NC_AUTH_PASS: "adminpassword"
NEXTCLOUD_VERSION: 28.0.7
NEXTCLOUD_BRANCH: stable28
jobs:
analysis:
runs-on: macos-14
name: Analysis
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install from source
run: python3 -m pip install ".[dev]"
- name: Run Analysis
run: python3 -m pylint "nc_py_api/"
tests-maria:
needs: [analysis]
runs-on: ubuntu-22.04
name: 28.X.X • 🐘8.1 • 🐍3.10 • Maria
timeout-minutes: 60
services:
mariadb:
image: mariadb:11.4
env:
MARIADB_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: nextcloud
options: >-
--health-cmd mysqladmin ping
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 3306:3306
steps:
- name: Set up php
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring, fileinfo, intl, pdo_mysql, zip, gd
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: cache-nextcloud
id: nextcloud_setup
uses: actions/cache@v4
with:
path: nextcloud-${{ env.NEXTCLOUD_VERSION }}.tar.bz2
key: ${{ env.NEXTCLOUD_VERSION }}
- name: Download Nextcloud
if: steps.nextcloud_setup.outputs.cache-hit != 'true'
run: wget -q https://download.nextcloud.com/server/releases/nextcloud-${{ env.NEXTCLOUD_VERSION }}.tar.bz2
- name: Set up Nextcloud
run: |
tar -xjf nextcloud-${{ env.NEXTCLOUD_VERSION }}.tar.bz2 --strip-components 1
mkdir data
php occ maintenance:install --verbose --database=mysql --database-name=nextcloud \
--database-host=127.0.0.1 --database-user=root --database-pass=rootpassword \
--admin-user admin --admin-pass ${{ env.NC_AUTH_PASS }}
php occ config:system:set loglevel --value=1 --type=integer
php occ config:system:set debug --value=true --type=boolean
PHP_CLI_SERVER_WORKERS=2 php -S localhost:8080 &
- name: Checkout NcPyApi
uses: actions/checkout@v4
with:
path: nc_py_api
- name: Install NcPyApi
working-directory: nc_py_api
run: python3 -m pip -v install ".[dev]"
- name: Checkout AppAPI
uses: actions/checkout@v4
with:
path: apps/app_api
repository: cloud-py-api/app_api
- name: Install AppAPI
run: |
php occ app:enable app_api
cd nc_py_api
coverage run --data-file=.coverage.ci_install tests/_install.py &
echo $! > /tmp/_install.pid
python3 tests/_install_wait.py http://127.0.0.1:$APP_PORT/heartbeat "\"status\":\"ok\"" 15 0.5
python3 tests/_app_security_checks.py http://127.0.0.1:$APP_PORT
cd ..
sh nc_py_api/scripts/ci_register.sh "$APP_ID" "$APP_VERSION" "$APP_SECRET" "localhost" "$APP_PORT"
kill -15 $(cat /tmp/_install.pid)
timeout 3m tail --pid=$(cat /tmp/_install.pid) -f /dev/null
- name: Checkout Talk
uses: actions/checkout@v4
with:
path: apps/spreed
repository: nextcloud/spreed
ref: ${{ env.NEXTCLOUD_BRANCH }}
- name: Install Talk
working-directory: apps/spreed
run: make dev-setup
- name: Enable Talk
run: php occ app:enable spreed
- name: Generate coverage report (1)
working-directory: nc_py_api
run: |
coverage run --data-file=.coverage.talk_bot tests/_talk_bot.py &
echo $! > /tmp/_talk_bot.pid
coverage run --data-file=.coverage.ci -m pytest
kill -15 $(cat /tmp/_talk_bot.pid)
timeout 3m tail --pid=$(cat /tmp/_talk_bot.pid) -f /dev/null
coverage run --data-file=.coverage.at_the_end -m pytest tests/_tests_at_the_end.py
- name: Uninstall NcPyApi
run: |
php occ app_api:app:unregister "$APP_ID" --silent --force
php occ app_api:daemon:unregister manual_install
- name: Generate coverage report (2)
working-directory: nc_py_api
run: |
coverage run --data-file=.coverage.ci_install_models tests/_install_init_handler_models.py &
echo $! > /tmp/_install_models.pid
python3 tests/_install_wait.py http://127.0.0.1:$APP_PORT/heartbeat "\"status\":\"ok\"" 15 0.5
cd ..
sh nc_py_api/scripts/ci_register.sh "$APP_ID" "$APP_VERSION" "$APP_SECRET" "localhost" "$APP_PORT"
kill -15 $(cat /tmp/_install_models.pid)
timeout 3m tail --pid=$(cat /tmp/_install_models.pid) -f /dev/null
cd nc_py_api
coverage combine && coverage xml -o coverage_maria_${{ env.NEXTCLOUD_VERSION }}_3.10_8.1.xml
- name: Upload Codecov to artifacts
uses: actions/upload-artifact@v4
with:
name: coverage_maria_${{ env.NEXTCLOUD_VERSION }}_3.10_8.1.xml
path: nc_py_api/coverage_maria_${{ env.NEXTCLOUD_VERSION }}_3.10_8.1.xml
if-no-files-found: error
- name: Upload NC logs
if: always()
uses: actions/upload-artifact@v4
with:
name: nc_log_maria_${{ env.NEXTCLOUD_VERSION }}_3.10_8.1
path: data/nextcloud.log
if-no-files-found: warn
tests-pgsql:
needs: [analysis]
runs-on: ubuntu-22.04
name: 28.X.X • 🐘8.2 • 🐍3.11 • PgSQL
env:
NC_dbname: nextcloud_abz
DATABASE_PGSQL: 1
timeout-minutes: 60
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: rootpassword
POSTGRES_DB: ${{ env.NC_dbname }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Set up php 8.2
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: mbstring, fileinfo, intl, pdo_mysql, zip, gd
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: cache-nextcloud
id: nextcloud_setup
uses: actions/cache@v4
with:
path: nextcloud-${{ env.NEXTCLOUD_VERSION }}.tar.bz2
key: ${{ env.NEXTCLOUD_VERSION }}
- name: Download Nextcloud
if: steps.nextcloud_setup.outputs.cache-hit != 'true'
run: wget -q https://download.nextcloud.com/server/releases/nextcloud-${{ env.NEXTCLOUD_VERSION }}.tar.bz2
- name: Set up Nextcloud
run: |
tar -xjf nextcloud-${{ env.NEXTCLOUD_VERSION }}.tar.bz2 --strip-components 1
mkdir data
php occ maintenance:install --verbose --database=pgsql --database-name=${{ env.NC_dbname }} \
--database-host=127.0.0.1 --database-user=root --database-pass=rootpassword \
--admin-user admin --admin-pass ${{ env.NC_AUTH_PASS }}
php occ config:system:set loglevel --value=1
php occ config:system:set debug --value=true --type=boolean
PHP_CLI_SERVER_WORKERS=2 php -S localhost:8080 &
- name: Checkout NcPyApi
uses: actions/checkout@v4
with:
path: nc_py_api
- name: Install NcPyApi
working-directory: nc_py_api
run: python3 -m pip -v install ".[dev]"
- name: Checkout AppAPI
uses: actions/checkout@v4
with:
path: apps/app_api
repository: cloud-py-api/app_api
- name: Install AppAPI
run: |
php occ app:enable app_api
cd nc_py_api
coverage run --data-file=.coverage.ci_install tests/_install.py &
echo $! > /tmp/_install.pid
python3 tests/_install_wait.py http://127.0.0.1:$APP_PORT/heartbeat "\"status\":\"ok\"" 15 0.5
python3 tests/_app_security_checks.py http://127.0.0.1:$APP_PORT
cd ..
sh nc_py_api/scripts/ci_register.sh "$APP_ID" "$APP_VERSION" "$APP_SECRET" "localhost" "$APP_PORT"
kill -15 $(cat /tmp/_install.pid)
timeout 3m tail --pid=$(cat /tmp/_install.pid) -f /dev/null
- name: Checkout Talk
uses: actions/checkout@v4
with:
path: apps/spreed
repository: nextcloud/spreed
ref: ${{ env.NEXTCLOUD_BRANCH }}
- name: Install Talk
working-directory: apps/spreed
run: make dev-setup
- name: Enable Talk
run: php occ app:enable spreed
- name: Generate coverage report (1)
working-directory: nc_py_api
run: |
coverage run --data-file=.coverage.talk_bot tests/_talk_bot.py &
echo $! > /tmp/_talk_bot.pid
coverage run --data-file=.coverage.ci -m pytest
kill -15 $(cat /tmp/_talk_bot.pid)
timeout 3m tail --pid=$(cat /tmp/_talk_bot.pid) -f /dev/null
coverage run --data-file=.coverage.at_the_end -m pytest tests/_tests_at_the_end.py
- name: Uninstall NcPyApi
run: |
php occ app_api:app:unregister "$APP_ID" --silent --force
php occ app_api:daemon:unregister manual_install
- name: Generate coverage report (2)
working-directory: nc_py_api
run: |
coverage run --data-file=.coverage.ci_install_models tests/_install_init_handler_models.py &
echo $! > /tmp/_install_models.pid
python3 tests/_install_wait.py http://127.0.0.1:$APP_PORT/heartbeat "\"status\":\"ok\"" 15 0.5
cd ..
sh nc_py_api/scripts/ci_register.sh "$APP_ID" "$APP_VERSION" "$APP_SECRET" "localhost" "$APP_PORT"
kill -15 $(cat /tmp/_install_models.pid)
timeout 3m tail --pid=$(cat /tmp/_install_models.pid) -f /dev/null
cd nc_py_api
coverage combine && coverage xml -o coverage_pgsql_${{ env.NEXTCLOUD_VERSION }}_3.11_8.2.xml
- name: Upload Codecov to artifacts
uses: actions/upload-artifact@v4
with:
name: coverage_pgsql_${{ env.NEXTCLOUD_VERSION }}_3.11_8.2.xml
path: nc_py_api/coverage_pgsql_${{ env.NEXTCLOUD_VERSION }}_3.11_8.2.xml
if-no-files-found: error
- name: Upload NC logs
if: always()
uses: actions/upload-artifact@v4
with:
name: nc_log_pgsql_${{ env.NEXTCLOUD_VERSION }}_3.11_8.2
path: data/nextcloud.log
if-no-files-found: warn
tests-oci:
needs: [analysis]
runs-on: ubuntu-22.04
name: stable28 • 🐘8.1 • 🐍3.11 • OCI
timeout-minutes: 60
services:
oracle:
image: ghcr.io/gvenzl/oracle-xe:11
env:
ORACLE_RANDOM_PASSWORD: true
APP_USER: useroracle
APP_USER_PASSWORD: userpassword
options: >-
--health-cmd healthcheck.sh
--health-interval 10s
--health-timeout 5s
--health-retries 10
ports:
- 1521:1521/tcp
steps:
- name: Set up php
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, \
posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, oci8
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Checkout server
uses: actions/checkout@v4
with:
submodules: true
repository: nextcloud/server
ref: ${{ env.NEXTCLOUD_BRANCH }}
- name: Checkout Notifications
uses: actions/checkout@v4
with:
repository: nextcloud/notifications
ref: ${{ env.NEXTCLOUD_BRANCH }}
path: apps/notifications
- name: Set up Nextcloud
run: |
mkdir data
php occ maintenance:install --verbose --database=oci --database-name=XE \
--database-host=127.0.0.1 --database-port=1521 --database-user=useroracle --database-pass=userpassword \
--admin-user admin --admin-pass ${{ env.NC_AUTH_PASS }}
php occ config:system:set loglevel --value=1 --type=integer
php occ config:system:set debug --value=true --type=boolean
PHP_CLI_SERVER_WORKERS=2 php -S localhost:8080 &
- name: Checkout NcPyApi
uses: actions/checkout@v4
with:
path: nc_py_api
- name: Install NcPyApi
working-directory: nc_py_api
run: python3 -m pip -v install ".[app,dev-min]"
- name: Checkout AppAPI
uses: actions/checkout@v4
with:
path: apps/app_api
repository: cloud-py-api/app_api
- name: Install AppAPI
run: |
php occ app:enable app_api
cd nc_py_api
coverage run --data-file=.coverage.ci_install tests/_install.py &
echo $! > /tmp/_install.pid
python3 tests/_install_wait.py http://127.0.0.1:$APP_PORT/heartbeat "\"status\":\"ok\"" 15 0.5
python3 tests/_app_security_checks.py http://127.0.0.1:$APP_PORT
cd ..
sh nc_py_api/scripts/ci_register.sh "$APP_ID" "$APP_VERSION" "$APP_SECRET" "localhost" "$APP_PORT"
kill -15 $(cat /tmp/_install.pid)
timeout 3m tail --pid=$(cat /tmp/_install.pid) -f /dev/null
- name: Generate coverage report
working-directory: nc_py_api
run: |
coverage run --data-file=.coverage.ci -m pytest
coverage run --data-file=.coverage.at_the_end -m pytest tests/_tests_at_the_end.py
coverage combine && coverage xml -o coverage_oci_${{ env.NEXTCLOUD_BRANCH }}_3.11_8.1.xml
env:
SKIP_NC_CLIENT_TESTS: 1
- name: Upload Codecov to artifacts
uses: actions/upload-artifact@v4
with:
name: coverage_oci_${{ env.NEXTCLOUD_BRANCH }}_3.11_8.1.xml
path: nc_py_api/coverage_oci_${{ env.NEXTCLOUD_BRANCH }}_3.11_8.1.xml
if-no-files-found: error
- name: Upload NC logs
if: always()
uses: actions/upload-artifact@v4
with:
name: nc_log_oci_${{ env.NEXTCLOUD_BRANCH }}_3.11_8.1
path: data/nextcloud.log
if-no-files-found: warn
tests-latest-maria:
needs: [analysis]
runs-on: ubuntu-22.04
name: ${{ matrix.nextcloud }} • 🐘8.2 • 🐍3.10 • Maria
strategy:
fail-fast: false
matrix:
nextcloud: [ 'stable28', 'stable29', 'master' ]
timeout-minutes: 60
services:
mariadb:
image: mariadb:11.4
env:
MARIADB_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: nextcloud
options: >-
--health-cmd mysqladmin ping
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 3306:3306
steps:
- name: Set up php
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: mbstring, fileinfo, intl, pdo_mysql, zip, gd, curl
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Checkout server
uses: actions/checkout@v4
with:
submodules: true
repository: nextcloud/server
ref: ${{ matrix.nextcloud }}
- name: Checkout Notifications
uses: actions/checkout@v4
with:
repository: nextcloud/notifications
ref: ${{ matrix.nextcloud }}
path: apps/notifications
- name: Checkout Notes
uses: actions/checkout@v4
if: ${{ !startsWith(matrix.nextcloud, 'master') }}
with:
repository: nextcloud/notes
ref: "main"
path: apps/notes
- name: Checkout Files Locking
uses: actions/checkout@v4
if: ${{ !startsWith(matrix.nextcloud, 'master') }}
with:
repository: nextcloud/files_lock
ref: ${{ matrix.nextcloud }}
path: apps/files_lock
- name: Set up & run Nextcloud
env:
DB_PORT: 4444
run: |
mkdir data
./occ maintenance:install --verbose --database=mysql --database-name=nextcloud \
--database-host=127.0.0.1 --database-user=root --database-pass=rootpassword \
--admin-user admin --admin-pass ${{ env.NC_AUTH_PASS }}
./occ config:system:set loglevel --value=0 --type=integer
./occ config:system:set debug --value=true --type=boolean
./occ app:enable notifications
PHP_CLI_SERVER_WORKERS=2 php -S localhost:8080 &
- name: Enable Files Locking
if: ${{ !startsWith(matrix.nextcloud, 'master') }}
run: ./occ app:enable files_lock
- name: Enable Notes
if: ${{ !startsWith(matrix.nextcloud, 'master') }}
run: ./occ app:enable notes
- name: Checkout NcPyApi
uses: actions/checkout@v4
with:
path: nc_py_api
- name: Install NcPyApi
working-directory: nc_py_api
run: python3 -m pip -v install ".[dev]"
- name: Checkout AppAPI
uses: actions/checkout@v4
with:
path: apps/app_api
repository: cloud-py-api/app_api
- name: Install AppAPI
run: |
php occ app:enable app_api
cd nc_py_api
coverage run --data-file=.coverage.ci_install tests/_install.py &
echo $! > /tmp/_install.pid
python3 tests/_install_wait.py http://127.0.0.1:$APP_PORT/heartbeat "\"status\":\"ok\"" 15 0.5
python3 tests/_app_security_checks.py http://127.0.0.1:$APP_PORT
cd ..
sh nc_py_api/scripts/ci_register.sh "$APP_ID" "$APP_VERSION" "$APP_SECRET" "localhost" "$APP_PORT"
kill -15 $(cat /tmp/_install.pid)
timeout 3m tail --pid=$(cat /tmp/_install.pid) -f /dev/null
- name: Talk Branch Main
if: ${{ startsWith(matrix.nextcloud, 'master') }}
run: echo "TALK_BRANCH_NAME=main" >> $GITHUB_ENV
- name: Talk Branch Other
if: ${{ !startsWith(matrix.nextcloud, 'master') }}
run: echo "TALK_BRANCH_NAME=${{ matrix.nextcloud }}" >> $GITHUB_ENV
- name: Checkout Talk
uses: actions/checkout@v4
with:
path: apps/spreed
repository: nextcloud/spreed
ref: ${{ env.TALK_BRANCH_NAME }}
- name: Install Talk
working-directory: apps/spreed
run: make dev-setup
- name: Enable Talk
run: php occ app:enable spreed
- name: Generate coverage report (1)
working-directory: nc_py_api
run: |
coverage run --data-file=.coverage.talk_bot tests/_talk_bot_async.py &
echo $! > /tmp/_talk_bot.pid
coverage run --data-file=.coverage.ci -m pytest
kill -15 $(cat /tmp/_talk_bot.pid)
timeout 3m tail --pid=$(cat /tmp/_talk_bot.pid) -f /dev/null
coverage run --data-file=.coverage.at_the_end -m pytest tests/_tests_at_the_end.py
- name: Uninstall NcPyApi
run: |
php occ app_api:app:unregister "$APP_ID" --silent --force
php occ app_api:daemon:unregister manual_install
- name: Generate coverage report (2)
working-directory: nc_py_api
run: |
coverage run --data-file=.coverage.ci_install_models tests/_install_init_handler_models.py &
echo $! > /tmp/_install_models.pid
python3 tests/_install_wait.py http://127.0.0.1:$APP_PORT/heartbeat "\"status\":\"ok\"" 15 0.5
cd ..
sh nc_py_api/scripts/ci_register.sh "$APP_ID" "$APP_VERSION" "$APP_SECRET" "localhost" "$APP_PORT"
kill -15 $(cat /tmp/_install_models.pid)
timeout 3m tail --pid=$(cat /tmp/_install_models.pid) -f /dev/null
cd nc_py_api
coverage combine && coverage xml -o coverage_maria_${{ matrix.nextcloud }}.xml
- name: Upload Codecov to artifacts
uses: actions/upload-artifact@v4
with:
name: coverage_maria_${{ matrix.nextcloud }}.xml
path: nc_py_api/coverage_maria_${{ matrix.nextcloud }}.xml
if-no-files-found: error
- name: Upload NC logs
if: always()
uses: actions/upload-artifact@v4
with:
name: nc_log_maria_${{ matrix.nextcloud }}
path: data/nextcloud.log
if-no-files-found: warn
test-latest-pgsql:
needs: [analysis]
runs-on: ubuntu-22.04
name: ${{ matrix.nextcloud }} • 🐘8.2 • 🐍3.11 • PgSQL
strategy:
fail-fast: false
matrix:
nextcloud: [ 'stable28', 'stable29', 'master' ]
env:
NC_dbname: nextcloud_abz
DATABASE_PGSQL: 1
timeout-minutes: 60
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: rootpassword
POSTGRES_DB: ${{ env.NC_dbname }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Set up php
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: mbstring, fileinfo, intl, pdo_mysql, zip, gd
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Checkout server
uses: actions/checkout@v4
with:
submodules: true
repository: nextcloud/server
ref: ${{ matrix.nextcloud }}
- name: Checkout Notifications
uses: actions/checkout@v4
with:
repository: nextcloud/notifications
ref: ${{ matrix.nextcloud }}
path: apps/notifications
- name: Checkout Activity
uses: actions/checkout@v4
with:
repository: nextcloud/activity
ref: ${{ matrix.nextcloud }}
path: apps/activity
- name: Set up & run Nextcloud
env:
DB_PORT: 4444
run: |
mkdir data
./occ maintenance:install --verbose --database=pgsql --database-name=${{ env.NC_dbname }} \
--database-host=127.0.0.1 --database-user=root --database-pass=rootpassword \
--admin-user admin --admin-pass ${{ env.NC_AUTH_PASS }}
./occ config:system:set loglevel --value=0 --type=integer
./occ config:system:set debug --value=true --type=boolean
./occ app:enable notifications
./occ app:enable activity
PHP_CLI_SERVER_WORKERS=2 php -S localhost:8080 &
- name: Checkout NcPyApi
uses: actions/checkout@v4
with:
path: nc_py_api
- name: Install NcPyApi
working-directory: nc_py_api
run: python3 -m pip -v install ".[dev]"
- name: Checkout AppAPI
uses: actions/checkout@v4
with:
path: apps/app_api
repository: cloud-py-api/app_api
- name: Install AppAPI
run: |
php occ app:enable app_api
cd nc_py_api
coverage run --data-file=.coverage.ci_install tests/_install_async.py &
echo $! > /tmp/_install.pid
python3 tests/_install_wait.py http://127.0.0.1:$APP_PORT/heartbeat "\"status\":\"ok\"" 15 0.5
python3 tests/_app_security_checks.py http://127.0.0.1:$APP_PORT
cd ..
sh nc_py_api/scripts/ci_register.sh "$APP_ID" "$APP_VERSION" "$APP_SECRET" "localhost" "$APP_PORT"
kill -15 $(cat /tmp/_install.pid)
timeout 3m tail --pid=$(cat /tmp/_install.pid) -f /dev/null
- name: Talk Branch Main
if: ${{ startsWith(matrix.nextcloud, 'master') }}
run: echo "TALK_BRANCH_NAME=main" >> $GITHUB_ENV
- name: Talk Branch Other
if: ${{ !startsWith(matrix.nextcloud, 'master') }}
run: echo "TALK_BRANCH_NAME=${{ matrix.nextcloud }}" >> $GITHUB_ENV
- name: Checkout Talk
uses: actions/checkout@v4
with:
path: apps/spreed
repository: nextcloud/spreed
ref: ${{ env.TALK_BRANCH_NAME }}
- name: Install Talk
working-directory: apps/spreed
run: |
make dev-setup
- name: Enable Talk
run: php occ app:enable spreed
- name: Generate coverage report (1)
working-directory: nc_py_api
run: |
coverage run --data-file=.coverage.talk_bot tests/_talk_bot_async.py &
echo $! > /tmp/_talk_bot.pid
coverage run --data-file=.coverage.ci -m pytest
kill -15 $(cat /tmp/_talk_bot.pid)
timeout 3m tail --pid=$(cat /tmp/_talk_bot.pid) -f /dev/null
coverage run --data-file=.coverage.at_the_end -m pytest tests/_tests_at_the_end.py
env:
NPA_TIMEOUT: None
NPA_TIMEOUT_DAV: None
NPA_NC_CERT: False
- name: Uninstall NcPyApi
run: |
php occ app_api:app:unregister "$APP_ID" --silent --force
php occ app_api:daemon:unregister manual_install
- name: Generate coverage report (2)
working-directory: nc_py_api
run: |
coverage run --data-file=.coverage.ci_install_models tests/_install_init_handler_models.py &
echo $! > /tmp/_install_models.pid
python3 tests/_install_wait.py http://127.0.0.1:$APP_PORT/heartbeat "\"status\":\"ok\"" 15 0.5
cd ..
sh nc_py_api/scripts/ci_register.sh "$APP_ID" "$APP_VERSION" "$APP_SECRET" "localhost" "$APP_PORT"
kill -15 $(cat /tmp/_install_models.pid)
timeout 3m tail --pid=$(cat /tmp/_install_models.pid) -f /dev/null
cd nc_py_api
coverage combine && coverage xml -o coverage_pgsql_${{ matrix.nextcloud }}.xml
- name: Upload Codecov to artifacts
uses: actions/upload-artifact@v4
with:
name: coverage_pgsql_${{ matrix.nextcloud }}.xml
path: nc_py_api/coverage_pgsql_${{ matrix.nextcloud }}.xml
if-no-files-found: error
- name: Upload NC logs
if: always()
uses: actions/upload-artifact@v4
with:
name: nc_log_pgsql_${{ matrix.nextcloud }}
path: data/nextcloud.log
if-no-files-found: warn
tests-client-sqlite:
needs: [analysis]
runs-on: ubuntu-22.04
name: ${{ matrix.nextcloud }} • 🐍3.12 • Client
strategy:
fail-fast: false
matrix:
nextcloud: [ 'stable27', 'stable28', 'stable29', 'master' ]
env:
NEXTCLOUD_URL: "http://localhost:8080/index.php"
timeout-minutes: 60
steps:
- name: Set up php
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, zip, gd, curl
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Checkout server
uses: actions/checkout@v4
with:
submodules: true
repository: nextcloud/server
ref: ${{ matrix.nextcloud }}
- name: Checkout Activity
uses: actions/checkout@v4
with:
repository: nextcloud/activity
ref: ${{ matrix.nextcloud }}
path: apps/activity
- name: Checkout Notes
uses: actions/checkout@v4
if: ${{ !startsWith(matrix.nextcloud, 'master') }}
with:
repository: nextcloud/notes
ref: "main"
path: apps/notes
- name: Checkout Files Locking
uses: actions/checkout@v4
if: ${{ !startsWith(matrix.nextcloud, 'stable27') && !startsWith(matrix.nextcloud, 'master') }}
with:
repository: nextcloud/files_lock
ref: ${{ matrix.nextcloud }}
path: apps/files_lock
- name: Set up & run Nextcloud
env:
DB_PORT: 4444
run: |
mkdir data
./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 \
--database-port=$DB_PORT --database-user=root --database-pass=rootpassword \
--admin-user admin --admin-pass ${{ env.NC_AUTH_PASS }}
./occ config:system:set loglevel --value=0 --type=integer
./occ config:system:set debug --value=true --type=boolean
./occ app:enable activity
PHP_CLI_SERVER_WORKERS=2 php -S localhost:8080 &
- name: Enable Notes
if: ${{ !startsWith(matrix.nextcloud, 'stable27') && !startsWith(matrix.nextcloud, 'master') }}
run: ./occ app:enable notes
- name: Enable Files Locking
if: ${{ !startsWith(matrix.nextcloud, 'stable27') && !startsWith(matrix.nextcloud, 'master') }}
run: ./occ app:enable files_lock
- name: Checkout NcPyApi
uses: actions/checkout@v4
with:
path: nc_py_api
- name: Install NcPyApi
working-directory: nc_py_api
run: python3 -m pip -v install . pytest pytest-asyncio coverage pillow
- name: Talk Branch Main
if: ${{ startsWith(matrix.nextcloud, 'master') }}
run: echo "TALK_BRANCH_NAME=main" >> $GITHUB_ENV
- name: Talk Branch Other
if: ${{ !startsWith(matrix.nextcloud, 'master') }}
run: echo "TALK_BRANCH_NAME=${{ matrix.nextcloud }}" >> $GITHUB_ENV
- name: Checkout Talk
uses: actions/checkout@v4
with:
path: apps/spreed
repository: nextcloud/spreed
ref: ${{ env.TALK_BRANCH_NAME }}
- name: Install Talk
working-directory: apps/spreed
run: make dev-setup
- name: Enable Talk
run: php occ app:enable spreed
- name: Generate coverage report
working-directory: nc_py_api
run: coverage run -m pytest && coverage xml -o coverage_sqlite_${{ matrix.nextcloud }}_client.xml
env:
SKIP_AA_TESTS: 1
NPA_NC_CERT: ''
- name: Upload Codecov to artifacts
uses: actions/upload-artifact@v4
with:
name: coverage_sqlite_${{ matrix.nextcloud }}_client.xml
path: nc_py_api/coverage_sqlite_${{ matrix.nextcloud }}_client.xml
if-no-files-found: error
- name: Upload NC logs
if: always()
uses: actions/upload-artifact@v4
with:
name: nc_log_sqlite_${{ matrix.nextcloud }}
path: data/nextcloud.log
if-no-files-found: warn
tests-upload-coverage:
needs: [tests-maria, tests-pgsql, tests-oci, tests-latest-maria, test-latest-pgsql, tests-client-sqlite]
permissions:
contents: none
runs-on: ubuntu-22.04
name: Upload Coverage
steps:
- uses: actions/checkout@v4
- name: Download Coverage Artifacts
uses: actions/download-artifact@v4
with:
path: coverage
pattern: coverage_*
merge-multiple: true
- name: Upload report to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: coverage
fail_ci_if_error: true
verbose: true
tests-success:
permissions:
contents: none
runs-on: ubuntu-22.04
needs: [tests-upload-coverage]
name: Tests-OK
steps:
- run: echo "Tests passed successfully"