@@ -2,7 +2,6 @@ name: (Py)Analysis & Coverage
2
2
3
3
on :
4
4
pull_request :
5
- types : [opened, edited, reopened, synchronize]
6
5
paths :
7
6
- ' nc_py_api/*.*'
8
7
- ' tests/nc_py_api/**'
@@ -324,3 +323,84 @@ jobs:
324
323
file : apps/${{ env.APP_NAME }}/coverage.xml
325
324
fail_ci_if_error : true
326
325
verbose : true
326
+
327
+ tests-mysql-socket :
328
+ needs : [analysis]
329
+ runs-on : ubuntu-22.04
330
+ name : ${{ matrix.nextcloud }} • PHP ${{ matrix.php-version }} • MySQL • SOCK
331
+ if : " !contains(github.event.head_commit.message, '[docs]')"
332
+ strategy :
333
+ fail-fast : false
334
+ matrix :
335
+ php-version : [ "7.4", "8.0" ]
336
+ nextcloud : [ "25.0.2" ]
337
+
338
+ steps :
339
+ - name : Set up php ${{ matrix.php-version }}
340
+ uses : shivammathur/setup-php@v2
341
+ with :
342
+ php-version : ${{ matrix.php-version }}
343
+ extensions : mbstring, fileinfo, intl, pdo_mysql, zip, gd
344
+
345
+ - uses : actions/setup-python@v4
346
+ with :
347
+ python-version : ' 3.9'
348
+
349
+ - name : cache-nextcloud
350
+ id : nextcloud_setup
351
+ uses : actions/cache@v3
352
+ with :
353
+ path : nextcloud-${{ matrix.nextcloud }}.tar.bz2
354
+ key : ${{ matrix.nextcloud }}
355
+
356
+ - name : Download Nextcloud
357
+ if : steps.nextcloud_setup.outputs.cache-hit != 'true'
358
+ run : wget -q https://download.nextcloud.com/server/releases/nextcloud-${{ matrix.nextcloud }}.tar.bz2
359
+
360
+ - name : Set up Nextcloud
361
+ run : |
362
+ sudo sed -i "s/.*port.*3306.*/port = 3307/" /etc/mysql/mysql.conf.d/mysqld.cnf
363
+ sudo systemctl restart mysql.service
364
+ mysql -uroot -proot -e "CREATE DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;"
365
+ mysql -uroot -proot -e "show databases;"
366
+ tar -xjf nextcloud-${{ matrix.nextcloud }}.tar.bz2 --strip-components 1
367
+ mkdir data
368
+ php occ maintenance:install --verbose --database=mysql --database-name=nextcloud \
369
+ --database-user=root --database-pass=root \
370
+ --admin-user admin --admin-pass adminpassword
371
+ php occ config:system:set debug --value=true --type=boolean
372
+ php -S localhost:8080 &
373
+
374
+ - uses : actions/checkout@v3
375
+ with :
376
+ path : apps/${{ env.APP_NAME }}
377
+
378
+ - name : Enable App & Test Data
379
+ run : |
380
+ php occ app:enable ${{ env.APP_NAME }}
381
+ cp -R apps/${{ env.APP_NAME }}/tests/nc_py_api/test_dir ./data/admin/files/
382
+ php occ files:scan admin
383
+
384
+ - name : Generate coverage report
385
+ working-directory : apps/${{ env.APP_NAME }}
386
+ run : |
387
+ python3 -m pip -v install ".[dev]"
388
+ coverage run -m pytest -s && coverage xml && coverage html
389
+ env :
390
+ SERVER_ROOT : " ../.."
391
+ CPA_LOGLEVEL : debug
392
+
393
+ - name : HTML coverage to artifacts
394
+ uses : actions/upload-artifact@v3
395
+ with :
396
+ name : coverage_${{ matrix.nextcloud }}_${{ matrix.php-version }}_mysql_socket
397
+ path : apps/${{ env.APP_NAME }}/htmlcov
398
+ if-no-files-found : error
399
+
400
+ - name : Upload report to Codecov
401
+ uses : codecov/codecov-action@v3
402
+ with :
403
+ token : ${{ secrets.CODECOV_TOKEN }}
404
+ file : apps/${{ env.APP_NAME }}/coverage.xml
405
+ fail_ci_if_error : true
406
+ verbose : true
0 commit comments