Skip to content

Commit 8db55b6

Browse files
Test against php8
Signed-off-by: Christoph Wurst <[email protected]>
1 parent 8fd845f commit 8db55b6

14 files changed

+1632
-996
lines changed

.github/workflows/php-test.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
php-versions: ['7.2', '7.3', '7.4']
14+
php-versions: ['7.3', '7.4']
1515
nextcloud-versions: ['stable20', 'master']
16-
exclude:
16+
include:
1717
- php-versions: '7.2'
18+
nextcloud-versions: 'stable20'
19+
- php-versions: '8.0'
1820
nextcloud-versions: 'master'
1921
name: php${{ matrix.php-versions }} on ${{ matrix.nextcloud-versions }} unit tests
22+
env:
23+
CI: true
24+
XDEBUG_MODE: coverage
2025
steps:
2126
- name: Set up php${{ matrix.php-versions }}
2227
uses: shivammathur/setup-php@master
@@ -26,18 +31,27 @@ jobs:
2631
coverage: xdebug
2732
- name: Checkout Nextcloud
2833
run: git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b ${{ matrix.nextcloud-versions }} nextcloud
29-
- name: Run tests
34+
- name: Install Nextcloud
3035
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=''
31-
- name: Checkout
36+
- name: Checkout the app
3237
uses: actions/checkout@master
3338
with:
3439
path: nextcloud/apps/calendar
40+
- name: Fix php-parser on stable20 incompatibility with phpunit 9.3+
41+
if: ${{ matrix.nextcloud-versions == 'stable20' }}
42+
working-directory: nextcloud/3rdparty
43+
run: composer require nikic/php-parser:4.10
44+
- name: Downgrade phpunit for php7.2
45+
if: ${{ matrix.php-versions == '7.2' }}
46+
working-directory: nextcloud/apps/calendar
47+
run: composer update christophwurst/nextcloud_testing -W
3548
- name: Install dependencies
3649
working-directory: nextcloud/apps/calendar
3750
run: composer install
3851
- name: Run tests
3952
working-directory: nextcloud/apps/calendar
4053
run: composer run test
4154
- name: Upload coverage to Codecov
55+
if: ${{ matrix.nextcloud-versions == 'master' }}
4256
working-directory: nextcloud/apps/calendar
4357
run: curl -s https://codecov.io/bash | bash -s - -t ${{ secrets.CODECOV_TOKEN }} -F php -f clover.unit.xml -Z

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,10 @@ RCS/*
9494

9595
/.project
9696
.php_cs.cache
97+
.phpunit.result.cache
9798

9899
coverage/
99100

100101
js/public
101102
css/public
103+

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
22
"require": {
3-
"php": ">=7.2",
3+
"php": "^7.2|^8.0",
44
"nextcloud/coding-standard": "^0.5.0"
55
},
66
"require-dev": {
7-
"christophwurst/nextcloud": "v20.0.4",
8-
"christophwurst/nextcloud_testing": "0.10.0"
7+
"christophwurst/nextcloud_testing": "0.12.1"
98
},
109
"scripts": {
1110
"cs:fix": "php-cs-fixer fix",

0 commit comments

Comments
 (0)