Skip to content

Commit 1d1da17

Browse files
authored
Merge pull request #53 from nextcloud/enh/noid/prepare-21
21: PHP 8 support/tests
2 parents ed01278 + 2a80822 commit 1d1da17

File tree

2 files changed

+255
-2
lines changed

2 files changed

+255
-2
lines changed

.drone.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: compatibility
33

44
steps:
55
- name: syntax-php7.4
6-
image: nextcloudci/php7.4:2
6+
image: nextcloudci/php7.4:php7.4-3
77
environment:
88
APP_NAME: data_request
99
CORE_BRANCH: master
@@ -32,6 +32,7 @@ trigger:
3232
- pull_request
3333
- push
3434

35+
type: docker
3536
---
3637
kind: pipeline
3738
name: unit-sqlite-php7.3
@@ -62,13 +63,15 @@ trigger:
6263
- pull_request
6364
- push
6465

66+
type: docker
67+
6568
---
6669
kind: pipeline
6770
name: unit-sqlite-php7.4
6871

6972
steps:
7073
- name: sqlite-php7.4
71-
image: nextcloudci/php7.4:2
74+
image: nextcloudci/php7.4:php7.4-3
7275
environment:
7376
APP_NAME: data_request
7477
CORE_BRANCH: master
@@ -91,3 +94,5 @@ trigger:
9194
event:
9295
- pull_request
9396
- push
97+
98+
type: docker

.github/workflows/phpunit.yml

Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
name: PHPUnit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
- stable*
9+
10+
env:
11+
APP_NAME: data_request
12+
13+
jobs:
14+
php:
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
# do not stop on another job's failure
19+
fail-fast: false
20+
matrix:
21+
php-versions: ['8.0']
22+
databases: ['sqlite']
23+
server-versions: ['master']
24+
25+
name: php${{ matrix.php-versions }}-${{ matrix.databases }}
26+
27+
steps:
28+
- name: Checkout server
29+
uses: actions/checkout@v2
30+
with:
31+
repository: nextcloud/server
32+
ref: ${{ matrix.server-versions }}
33+
34+
- name: Checkout submodules
35+
shell: bash
36+
run: |
37+
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
38+
git submodule sync --recursive
39+
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
40+
41+
- name: Checkout app
42+
uses: actions/checkout@v2
43+
with:
44+
path: apps/${{ env.APP_NAME }}
45+
46+
- name: Set up php ${{ matrix.php-versions }}
47+
uses: shivammathur/setup-php@v2
48+
with:
49+
php-version: ${{ matrix.php-versions }}
50+
extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite
51+
tools: phpunit:8.5.13
52+
coverage: none
53+
54+
- name: Set up Nextcloud
55+
env:
56+
DB_PORT: 4444
57+
run: |
58+
mkdir data
59+
./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
60+
php -f index.php
61+
./occ app:enable --force ${{ env.APP_NAME }}
62+
63+
- name: PHPUnit
64+
working-directory: apps/${{ env.APP_NAME }}/tests/unit
65+
run: phpunit -c phpunit.xml
66+
67+
mysql:
68+
runs-on: ubuntu-latest
69+
70+
strategy:
71+
# do not stop on another job's failure
72+
fail-fast: false
73+
matrix:
74+
php-versions: ['8.0']
75+
databases: ['mysql']
76+
server-versions: ['master']
77+
78+
name: php${{ matrix.php-versions }}-${{ matrix.databases }}
79+
80+
services:
81+
mysql:
82+
image: mariadb
83+
ports:
84+
- 4444:3306/tcp
85+
env:
86+
MYSQL_ROOT_PASSWORD: rootpassword
87+
options: --health-cmd="mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 5
88+
89+
steps:
90+
- name: Checkout server
91+
uses: actions/checkout@v2
92+
with:
93+
repository: nextcloud/server
94+
ref: ${{ matrix.server-versions }}
95+
96+
- name: Checkout submodules
97+
shell: bash
98+
run: |
99+
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
100+
git submodule sync --recursive
101+
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
102+
103+
- name: Checkout app
104+
uses: actions/checkout@v2
105+
with:
106+
path: apps/${{ env.APP_NAME }}
107+
108+
- name: Set up php ${{ matrix.php-versions }}
109+
uses: shivammathur/setup-php@v2
110+
with:
111+
php-version: ${{ matrix.php-versions }}
112+
extensions: mbstring, iconv, fileinfo, intl, mysql, pdo_mysql
113+
tools: phpunit:8.5.13
114+
coverage: none
115+
116+
- name: Set up Nextcloud
117+
env:
118+
DB_PORT: 4444
119+
run: |
120+
mkdir data
121+
./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
122+
php -f index.php
123+
./occ app:enable --force ${{ env.APP_NAME }}
124+
125+
- name: PHPUnit
126+
working-directory: apps/${{ env.APP_NAME }}/tests/unit
127+
run: phpunit -c phpunit.xml
128+
129+
pgsql:
130+
runs-on: ubuntu-latest
131+
132+
strategy:
133+
# do not stop on another job's failure
134+
fail-fast: false
135+
matrix:
136+
php-versions: ['8.0']
137+
databases: ['pgsql']
138+
server-versions: ['master']
139+
140+
name: php${{ matrix.php-versions }}-${{ matrix.databases }}
141+
142+
services:
143+
postgres:
144+
image: postgres
145+
ports:
146+
- 4444:5432/tcp
147+
env:
148+
POSTGRES_USER: root
149+
POSTGRES_PASSWORD: rootpassword
150+
POSTGRES_DB: nextcloud
151+
options: --health-cmd pg_isready --health-interval 5s --health-timeout 2s --health-retries 5
152+
153+
steps:
154+
- name: Checkout server
155+
uses: actions/checkout@v2
156+
with:
157+
repository: nextcloud/server
158+
ref: ${{ matrix.server-versions }}
159+
160+
- name: Checkout submodules
161+
shell: bash
162+
run: |
163+
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
164+
git submodule sync --recursive
165+
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
166+
167+
- name: Checkout app
168+
uses: actions/checkout@v2
169+
with:
170+
path: apps/${{ env.APP_NAME }}
171+
172+
- name: Set up php ${{ matrix.php-versions }}
173+
uses: shivammathur/setup-php@v2
174+
with:
175+
php-version: ${{ matrix.php-versions }}
176+
extensions: mbstring, iconv, fileinfo, intl, pgsql, pdo_pgsql
177+
tools: phpunit:8.5.13
178+
coverage: none
179+
180+
- name: Set up Nextcloud
181+
env:
182+
DB_PORT: 4444
183+
run: |
184+
mkdir data
185+
./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
186+
php -f index.php
187+
./occ app:enable --force ${{ env.APP_NAME }}
188+
189+
- name: PHPUnit
190+
working-directory: apps/${{ env.APP_NAME }}/tests/unit
191+
run: phpunit -c phpunit.xml
192+
193+
oci:
194+
runs-on: ubuntu-latest
195+
196+
strategy:
197+
# do not stop on another job's failure
198+
fail-fast: false
199+
matrix:
200+
php-versions: ['7.4', '8.0']
201+
databases: ['oci']
202+
server-versions: ['master']
203+
204+
name: php${{ matrix.php-versions }}-${{ matrix.databases }}
205+
206+
services:
207+
oracle:
208+
image: deepdiver/docker-oracle-xe-11g # "wnameless/oracle-xe-11g-r2"
209+
ports:
210+
- "1521:1521"
211+
212+
steps:
213+
- name: Checkout server
214+
uses: actions/checkout@v2
215+
with:
216+
repository: nextcloud/server
217+
ref: ${{ matrix.server-versions }}
218+
219+
- name: Checkout submodules
220+
shell: bash
221+
run: |
222+
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
223+
git submodule sync --recursive
224+
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
225+
226+
- name: Checkout app
227+
uses: actions/checkout@v2
228+
with:
229+
path: apps/${{ env.APP_NAME }}
230+
231+
- name: Set up php ${{ matrix.php-versions }}
232+
uses: shivammathur/setup-php@v2
233+
with:
234+
php-version: ${{ matrix.php-versions }}
235+
extensions: mbstring, iconv, fileinfo, intl, oci8
236+
tools: phpunit:8.5.13
237+
coverage: none
238+
239+
- name: Set up Nextcloud
240+
run: |
241+
mkdir data
242+
./occ maintenance:install --verbose --database=${{ matrix.databases }} --database-name=XE --database-host=127.0.0.1 --database-port=1521 --database-user=autotest --database-pass=owncloud --admin-user admin --admin-pass admin
243+
php -f index.php
244+
./occ app:enable --force ${{ env.APP_NAME }}
245+
246+
- name: PHPUnit
247+
working-directory: apps/${{ env.APP_NAME }}/tests/unit
248+
run: phpunit -c phpunit.xml

0 commit comments

Comments
 (0)