Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
php-versions: ['7.4', '8.0']
php-versions: ['7.4', '8.0', "8.1"]

name: php${{ matrix.php-versions }}
steps:
Expand Down
58 changes: 37 additions & 21 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
databases: ['sqlite']
server-versions: ['master']

name: php${{ matrix.php-versions }}-${{ matrix.databases }}
name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }}

steps:
- name: Checkout server
Expand All @@ -47,22 +47,26 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: phpunit
extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite
tools: phpunit:8.5.13
coverage: none

- name: Set up PHPUnit
working-directory: apps/${{ env.APP_NAME }}
run: composer i

- name: Set up Nextcloud
env:
DB_PORT: 4444
run: |
mkdir data
./occ maintenance:install --verbose --database=${{ matrix.databases }} --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password
php -f index.php
./occ app:enable --force ${{ env.APP_NAME }}
php -S localhost:8080 &

- name: PHPUnit
working-directory: apps/${{ env.APP_NAME }}/tests/unit
run: phpunit -c phpunit.xml
working-directory: apps/${{ env.APP_NAME }}/tests
run: ../vendor/bin/phpunit -c phpunit.xml

mysql:
runs-on: ubuntu-latest
Expand All @@ -71,11 +75,11 @@ jobs:
# do not stop on another job's failure
fail-fast: false
matrix:
php-versions: ['7.4', '8.0']
php-versions: ['7.4', '8.0', '8.1']
databases: ['mysql']
server-versions: ['master']

name: php${{ matrix.php-versions }}-${{ matrix.databases }}
name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }}

services:
mysql:
Expand Down Expand Up @@ -109,22 +113,26 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, iconv, fileinfo, intl, mysql, pdo_mysql
tools: phpunit:8.5.13
tools: phpunit
extensions: mbstring, iconv, fileinfo, intl, mysql, pdo_mysql, zip, gd
coverage: none

- name: Set up PHPUnit
working-directory: apps/${{ env.APP_NAME }}
run: composer i

- name: Set up Nextcloud
env:
DB_PORT: 4444
run: |
mkdir data
./occ maintenance:install --verbose --database=${{ matrix.databases }} --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password
php -f index.php
./occ app:enable --force ${{ env.APP_NAME }}
php -S localhost:8080 &

- name: PHPUnit
working-directory: apps/${{ env.APP_NAME }}/tests/unit
run: phpunit -c phpunit.xml
working-directory: apps/${{ env.APP_NAME }}/tests
run: ../vendor/bin/phpunit -c phpunit.xml

pgsql:
runs-on: ubuntu-latest
Expand All @@ -137,7 +145,7 @@ jobs:
databases: ['pgsql']
server-versions: ['master']

name: php${{ matrix.php-versions }}-${{ matrix.databases }}
name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }}

services:
postgres:
Expand Down Expand Up @@ -173,22 +181,26 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: phpunit
extensions: mbstring, iconv, fileinfo, intl, pgsql, pdo_pgsql
tools: phpunit:8.5.13
coverage: none

- name: Set up PHPUnit
working-directory: apps/${{ env.APP_NAME }}
run: composer i

- name: Set up Nextcloud
env:
DB_PORT: 4444
run: |
mkdir data
./occ maintenance:install --verbose --database=${{ matrix.databases }} --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password
php -f index.php
./occ app:enable --force ${{ env.APP_NAME }}
php -S localhost:8080 &

- name: PHPUnit
working-directory: apps/${{ env.APP_NAME }}/tests/unit
run: phpunit -c phpunit.xml
working-directory: apps/${{ env.APP_NAME }}/tests
run: ../vendor/bin/phpunit -c phpunit.xml

oci:
runs-on: ubuntu-latest
Expand All @@ -201,7 +213,7 @@ jobs:
databases: ['oci']
server-versions: ['master']

name: php${{ matrix.php-versions }}-${{ matrix.databases }}
name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }}

services:
oracle:
Expand Down Expand Up @@ -233,9 +245,13 @@ jobs:
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, iconv, fileinfo, intl, oci8
tools: phpunit:8.5.13
tools: phpunit
coverage: none

- name: Set up PHPUnit
working-directory: apps/${{ env.APP_NAME }}
run: composer i

- name: Set up Nextcloud
run: |
mkdir data
Expand All @@ -244,5 +260,5 @@ jobs:
./occ app:enable --force ${{ env.APP_NAME }}

- name: PHPUnit
working-directory: apps/${{ env.APP_NAME }}/tests/unit
run: phpunit -c phpunit.xml
working-directory: apps/${{ env.APP_NAME }}/tests
run: ../vendor/bin/phpunit -c phpunit.xml
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './build/*' -print0 | xargs -0 -n1 php -l"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"nextcloud/coding-standard": "^0.5.0",
"christophwurst/nextcloud": "dev-master"
}
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/phpunit.xml → tests/phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<phpunit bootstrap="bootstrap.php"
<phpunit bootstrap="unit/bootstrap.php"
strict="true"
verbose="true"
timeoutForSmallTests="900"
Expand All @@ -12,9 +12,9 @@
<!-- filters for code coverage -->
<filter>
<whitelist>
<directory suffix=".php">../../../impersonate</directory>
<directory suffix=".php">../../impersonate</directory>
<exclude>
<directory suffix=".php">../../../impersonate/tests</directory>
<directory suffix=".php">../../impersonate/tests</directory>
</exclude>
</whitelist>
</filter>
Expand Down