-
-
Notifications
You must be signed in to change notification settings - Fork 36
149 lines (131 loc) · 4.28 KB
/
Copy pathphpunit.yml
File metadata and controls
149 lines (131 loc) · 4.28 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# SPDX-FileCopyrightText: 2026 Marcel Scherello
# SPDX-License-Identifier: AGPL-3.0-or-later
name: Nextcloud compatibility
on:
workflow_dispatch:
permissions:
contents: read
env:
APP_NAME: analytics
jobs:
compatibility:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- nextcloud-version: stable29
php-version: '8.2'
database: sqlite
- nextcloud-version: stable30
php-version: '8.2'
database: sqlite
- nextcloud-version: stable31
php-version: '8.2'
database: mysql
- nextcloud-version: stable32
php-version: '8.3'
database: pgsql
- nextcloud-version: stable33
php-version: '8.4'
database: mysql
- nextcloud-version: stable34
php-version: '8.5'
database: pgsql
name: nc-${{ matrix.nextcloud-version }}-php${{ matrix.php-version }}-${{ matrix.database }}
services:
mysql:
image: mariadb:10.11
ports:
- 3306:3306
env:
MYSQL_DATABASE: nextcloud
MYSQL_USER: nextcloud
MYSQL_PASSWORD: nextcloud
MYSQL_ROOT_PASSWORD: rootpassword
options: >-
--health-cmd="healthcheck.sh --connect --innodb_initialized"
--health-interval=10s
--health-timeout=5s
--health-retries=5
postgres:
image: postgres:16
ports:
- 5432:5432
env:
POSTGRES_DB: nextcloud
POSTGRES_USER: nextcloud
POSTGRES_PASSWORD: nextcloud
options: >-
--health-cmd="pg_isready -U nextcloud -d nextcloud"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- name: Checkout Nextcloud server
uses: actions/checkout@v4
with:
repository: nextcloud/server
ref: ${{ matrix.nextcloud-version }}
submodules: recursive
- name: Checkout Analytics app
uses: actions/checkout@v4
with:
path: apps/${{ env.APP_NAME }}
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: apcu, bcmath, ctype, curl, dom, fileinfo, gd, iconv, intl, mbstring, mysqli, pdo_mysql, pdo_pgsql, pdo_sqlite, posix, simplexml, xmlreader, xmlwriter, zip
tools: phpunit:9.6
coverage: none
- name: Verify bundled app dependencies
working-directory: apps/${{ env.APP_NAME }}
run: test -f vendor/autoload.php
- name: Check PHP syntax
working-directory: apps/${{ env.APP_NAME }}
run: |
find appinfo lib templates tests -name '*.php' -print0 \
| xargs -0 -n 1 php -l
- name: Run standalone PHPUnit tests
working-directory: apps/${{ env.APP_NAME }}
run: phpunit --configuration phpunit.xml
- name: Install Nextcloud with ${{ matrix.database }}
run: |
mkdir -p data
case "${{ matrix.database }}" in
sqlite)
./occ maintenance:install \
--database=sqlite \
--admin-user=admin \
--admin-pass=admin
;;
mysql)
./occ maintenance:install \
--database=mysql \
--database-name=nextcloud \
--database-host=127.0.0.1 \
--database-port=3306 \
--database-user=nextcloud \
--database-pass=nextcloud \
--admin-user=admin \
--admin-pass=admin
;;
pgsql)
./occ maintenance:install \
--database=pgsql \
--database-name=nextcloud \
--database-host=127.0.0.1 \
--database-port=5432 \
--database-user=nextcloud \
--database-pass=nextcloud \
--admin-user=admin \
--admin-pass=admin
;;
esac
php -f index.php
- name: Enable Analytics app
run: |
./occ app:enable --force "${APP_NAME}"
./occ app:list --enabled | grep -F " - ${APP_NAME}:"
./occ status