-
-
Notifications
You must be signed in to change notification settings - Fork 18
73 lines (71 loc) · 2.68 KB
/
test.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
name: Test
on:
pull_request:
push:
branches:
- main
jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4', '8.0', '8.1', '8.2']
nextcloud-versions: ['stable25']
include:
- php-versions: 8.2
nextcloud-versions: stable30
- php-versions: 8.2
nextcloud-versions: stable29
- php-versions: 8.2
nextcloud-versions: stable28
- php-versions: 8.1
nextcloud-versions: stable27
- php-versions: 8.1
nextcloud-versions: stable26
- php-versions: 8.0
nextcloud-versions: stable24
- php-versions: 8.0
nextcloud-versions: stable23
- php-versions: 8.0
nextcloud-versions: stable22
name: Nextcloud ${{ matrix.nextcloud-versions }} php${{ matrix.php-versions }} unit tests
steps:
- name: Set up php${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ctype,curl,dom,gd,iconv,intl,json,mbstring,openssl,posix,sqlite,xml,zip,gmp
coverage: xdebug
- name: Checkout Nextcloud
run: git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b ${{ matrix.nextcloud-versions }} nextcloud
- name: Patch version check for nightly PHP
if: ${{ matrix.php-versions == '8.2' }}
run: echo "<?php" > nextcloud/lib/versioncheck.php
- name: Install Nextcloud
run: php -f nextcloud/occ maintenance:install --database-name oc_autotest --database-user oc_autotest --admin-user admin --admin-pass admin --database sqlite --database-pass=''
- name: Checkout qownnotesapi
uses: actions/checkout@v3
with:
path: nextcloud/apps/qownnotesapi
- name: Test app
run: php -f nextcloud/occ app:enable qownnotesapi && php -f nextcloud/occ background:cron
# - name: Install dependencies
# working-directory: nextcloud/apps/qownnotesapi
# run: composer install
# - name: PHPUnit tests
# uses: php-actions/phpunit@v3
# with:
# configuration: phpunit.coverage.xml
- name: Run tests
working-directory: nextcloud/apps/qownnotesapi
run: composer global require phpunit/phpunit && phpunit -c phpunit.coverage.xml --coverage-clover build/logs/clover.xml
if: ${{ matrix.php-versions == '8.0' }}
env:
XDEBUG_MODE: coverage
# - name: Report coverage
# uses: codecov/codecov-action@v3.1.0
# if: ${{ always() && matrix.php-versions == '8.0' }}
# with:
# file: ./nextcloud/apps/qownnotesapi/tests/clover.unit.xml
# flags: unittests
# fail_ci_if_error: true