forked from joomla-framework/database
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.jsonnet
326 lines (314 loc) · 12.2 KB
/
.drone.jsonnet
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
local volumes = [
{
name: 'composer-cache',
path: '/tmp/composer-cache',
},
];
local hostvolumes = [
{
name: 'composer-cache',
host: { path: '/tmp/composer-cache' },
},
];
local composer(phpversion, params) = {
name: 'Composer',
image: 'joomlaprojects/docker-images:php' + phpversion,
volumes: volumes,
commands: [
'php -v',
'sleep 20',
'composer update ' + params,
],
};
local phpunit_common(phpversion) = {
name: 'PHPUnit',
image: 'joomlaprojects/docker-images:php' + phpversion,
[if phpversion == '8.2' then 'failure']: 'ignore',
commands: [
'vendor/bin/phpunit --configuration phpunit.xml.dist --testdox',
],
};
local phpunit_mysql(phpversion, driver) = {
name: 'PHPUnit',
image: 'joomlaprojects/docker-images:php' + phpversion,
[if phpversion == '8.2' then 'failure']: 'ignore',
commands: [
'php --ri ' + driver + ' || true',
'sleep 20',
'vendor/bin/phpunit --configuration phpunit.' + driver + '.xml.dist --testdox',
],
};
local phpunit(phpversion, driver) = {
name: 'PHPUnit',
image: 'joomlaprojects/docker-images:php' + phpversion,
[if phpversion == '8.2' then 'failure']: 'ignore',
commands: [
'php --ri ' + driver + ' || true',
'vendor/bin/phpunit --configuration phpunit.' + driver + '.xml.dist --testdox',
],
};
local phpunit_sqlsrv(phpversion) = {
name: 'PHPUnit with MS SQL Server',
image: 'joomlaprojects/docker-images:php' + phpversion,
commands: [
'apt-get update',
'apt-get install -y software-properties-common lsb-release gnupg',
'curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -',
'echo "deb [arch=amd64,armhf,arm64] https://packages.microsoft.com/debian/11/prod bullseye main" >> /etc/apt/sources.list',
'apt-get update',
'ACCEPT_EULA=Y apt-get install -y msodbcsql18 unixodbc-dev',
'pecl install sqlsrv && docker-php-ext-enable sqlsrv',
'pecl install pdo_sqlsrv && docker-php-ext-enable pdo_sqlsrv',
'php --ri sqlsrv',
'php --ri pdo_sqlsrv',
'vendor/bin/phpunit --configuration phpunit.sqlsrv.xml.dist --testdox',
],
};
local pipeline_sqlite(phpversion, driver, params) = {
kind: 'pipeline',
name: 'PHP ' + phpversion + ' with SQLite (' + driver + ')',
environment: { DB: driver },
volumes: hostvolumes,
steps: [
composer(phpversion, params),
phpunit(phpversion, driver),
],
};
local pipeline_mysql(phpversion, driver, dbversion, params) = {
kind: 'pipeline',
name: 'PHP ' + phpversion + ' with MySQL ' + dbversion + ' (' + driver + ')',
environment: { DB: driver },
volumes: hostvolumes,
steps: [
composer(phpversion, params),
phpunit_mysql(phpversion, driver),
],
services: [
{
name: driver,
image: 'bitnami/mysql:' + dbversion,
environment: {
ALLOW_EMPTY_PASSWORD: 'yes',
MYSQL_DATABASE: 'joomla_ut',
MYSQL_ROOT_PASSWORD: '',
MYSQL_AUTHENTICATION_PLUGIN: 'mysql_native_password',
},
ports: [
{
container: 3306,
host: 3306,
},
],
},
],
};
local pipeline_mariadb(phpversion, driver, dbversion, params) = {
kind: 'pipeline',
name: 'PHP ' + phpversion + ' with MariaDB ' + dbversion + ' (' + driver + ')',
environment: { DB: driver },
volumes: hostvolumes,
steps: [
composer(phpversion, params),
phpunit(phpversion, driver),
],
services: [
{
name: driver,
image: 'mariadb:' + dbversion,
environment: {
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: 'yes',
MARIADB_DATABASE: 'joomla_ut',
MARIADB_ROOT_PASSWORD: '',
# Provide MySQL environments variables for MariaDB < 10.2.
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes',
MYSQL_DATABASE: 'joomla_ut',
MYSQL_ROOT_PASSWORD: '',
},
ports: [
{
container: 3306,
host: 3306,
},
],
},
],
};
local pipeline_postgres(phpversion, driver, dbversion, params) = {
kind: 'pipeline',
name: 'PHP ' + phpversion + ' with PostgreSQL ' + dbversion + ' (' + driver + ')',
environment: { DB: driver },
volumes: hostvolumes,
steps: [
composer(phpversion, params),
phpunit(phpversion, driver),
],
services: [
{
name: driver,
image: 'postgres:' + dbversion,
environment: {
POSTGRES_HOST_AUTH_METHOD: 'trust',
POSTGRES_PASSWORD: '',
POSTGRES_USER: 'postgres',
},
ports: [
{
container: 5432,
host: 5432,
},
],
commands: [
'psql -U postgres -c ',
'psql -U postgres -d joomla_ut -a -f Tests/Stubs/Schema/pgsql.sql',
],
},
],
};
local pipeline_sqlsrv(phpversion, driver, dbversion, params) = {
kind: 'pipeline',
name: 'PHP ' + phpversion + ' with MS SQL Server ' + dbversion + ' (' + driver + ')',
environment: { DB: driver },
volumes: hostvolumes,
steps: [
composer(phpversion, params),
phpunit_sqlsrv(phpversion),
],
services: [
{
name: driver,
image: 'mcr.microsoft.com/mssql/server:' + dbversion,
environment: {
ACCEPT_EULA: 'Y',
SA_PASSWORD: 'JoomlaFramework123',
},
ports: [
{
container: 1433,
host: 1433,
},
],
},
],
};
[
{
kind: 'pipeline',
name: 'Codequality',
volumes: hostvolumes,
steps: [
{
name: 'composer',
image: 'joomlaprojects/docker-images:php7.4',
volumes: volumes,
commands: [
'php -v',
'composer update',
'composer require phpmd/phpmd phpstan/phpstan',
],
},
{
name: 'phpcs',
image: 'joomlaprojects/docker-images:php7.4',
depends: [ 'composer' ],
commands: [
'vendor/bin/phpcs --config-set installed_paths vendor/joomla/coding-standards',
'vendor/bin/phpcs --standard=ruleset.xml src/',
],
},
{
name: 'phpmd',
image: 'joomlaprojects/docker-images:php7.4',
depends: [ 'composer' ],
failure: 'ignore',
commands: [
'vendor/bin/phpmd src text cleancode',
'vendor/bin/phpmd src text codesize',
'vendor/bin/phpmd src text controversial',
'vendor/bin/phpmd src text design',
'vendor/bin/phpmd src text unusedcode',
],
},
{
name: 'phpstan',
image: 'joomlaprojects/docker-images:php7.4',
depends: [ 'composer' ],
failure: 'ignore',
commands: [
'vendor/bin/phpstan analyse src',
],
},
{
name: 'phploc',
image: 'joomlaprojects/docker-images:php7.4',
depends: [ 'composer' ],
failure: 'ignore',
commands: [
'phploc src',
],
},
{
name: 'phpcpd',
image: 'joomlaprojects/docker-images:php7.4',
depends: [ 'composer' ],
failure: 'ignore',
commands: [
'phpcpd src',
],
},
],
},
pipeline_sqlite('7.2', 'sqlite', '--prefer-stable --prefer-lowest'),
pipeline_sqlite('7.3', 'sqlite', '--prefer-stable'),
pipeline_sqlite('7.4', 'sqlite', '--prefer-stable'),
pipeline_sqlite('8.0', 'sqlite', '--prefer-stable --ignore-platform-reqs'),
pipeline_sqlite('8.1', 'sqlite', '--prefer-stable --ignore-platform-reqs'),
pipeline_sqlite('8.2', 'sqlite', '--prefer-stable --ignore-platform-reqs'),
pipeline_mysql('7.2', 'mysql', '5.7', '--prefer-stable --prefer-lowest'),
pipeline_mysql('7.3', 'mysql', '5.7', '--prefer-stable'),
pipeline_mysql('7.4', 'mysql', '5.7', '--prefer-stable'),
pipeline_mysql('8.0', 'mysql', '5.7', '--prefer-stable --ignore-platform-reqs'),
pipeline_mysql('8.1', 'mysql', '5.7', '--prefer-stable --ignore-platform-reqs'),
pipeline_mysql('8.2', 'mysql', '5.7', '--prefer-stable --ignore-platform-reqs'),
pipeline_mysql('7.3', 'mysql', '8.0', '--prefer-stable'),
pipeline_mysql('7.4', 'mysql', '8.0', '--prefer-stable'),
pipeline_mysql('8.0', 'mysql', '8.0', '--prefer-stable --ignore-platform-reqs'),
pipeline_mysql('8.1', 'mysql', '8.0', '--prefer-stable --ignore-platform-reqs'),
pipeline_mysql('8.2', 'mysql', '8.0', '--prefer-stable --ignore-platform-reqs'),
pipeline_mysql('7.2', 'mysqli', '5.7', '--prefer-stable --prefer-lowest'),
pipeline_mysql('7.3', 'mysqli', '5.7', '--prefer-stable'),
pipeline_mysql('7.4', 'mysqli', '5.7', '--prefer-stable'),
pipeline_mysql('8.0', 'mysqli', '5.7', '--prefer-stable --ignore-platform-reqs'),
pipeline_mysql('8.1', 'mysqli', '5.7', '--prefer-stable --ignore-platform-reqs'),
pipeline_mysql('8.2', 'mysqli', '5.7', '--prefer-stable --ignore-platform-reqs'),
pipeline_mysql('7.3', 'mysqli', '8.0', '--prefer-stable'),
pipeline_mysql('7.4', 'mysqli', '8.0', '--prefer-stable'),
pipeline_mysql('8.0', 'mysqli', '8.0', '--prefer-stable --ignore-platform-reqs'),
pipeline_mysql('8.1', 'mysqli', '8.0', '--prefer-stable --ignore-platform-reqs'),
pipeline_mysql('8.2', 'mysqli', '8.0', '--prefer-stable --ignore-platform-reqs'),
pipeline_mariadb('7.2', 'mariadb', '10.2', '--prefer-stable --prefer-lowest'),
pipeline_mariadb('7.3', 'mariadb', '10.2', '--prefer-stable'),
pipeline_mariadb('7.4', 'mariadb', '10.0', '--prefer-stable'),
pipeline_mariadb('7.4', 'mariadb', '10.1', '--prefer-stable'),
pipeline_mariadb('7.4', 'mariadb', '10.2', '--prefer-stable'),
pipeline_mariadb('8.0', 'mariadb', '10.2', '--prefer-stable --ignore-platform-reqs'),
pipeline_mariadb('8.1', 'mariadb', '10.2', '--prefer-stable --ignore-platform-reqs'),
pipeline_mariadb('8.2', 'mariadb', '10.2', '--prefer-stable --ignore-platform-reqs'),
pipeline_postgres('7.2', 'pgsql', '9.4', '--prefer-stable --prefer-lowest'),
pipeline_postgres('7.2', 'pgsql', '9.5', '--prefer-stable --prefer-lowest'),
pipeline_postgres('7.3', 'pgsql', '9.6', '--prefer-stable'),
pipeline_postgres('7.3', 'pgsql', '10', '--prefer-stable'),
pipeline_postgres('7.4', 'pgsql', '10', '--prefer-stable'),
pipeline_postgres('8.0', 'pgsql', '10', '--prefer-stable --ignore-platform-reqs'),
pipeline_postgres('8.1', 'pgsql', '10', '--prefer-stable --ignore-platform-reqs'),
pipeline_postgres('8.2', 'pgsql', '10', '--prefer-stable --ignore-platform-reqs'),
pipeline_postgres('7.3', 'pgsql', '11', '--prefer-stable'),
pipeline_postgres('7.4', 'pgsql', '11', '--prefer-stable'),
pipeline_postgres('8.0', 'pgsql', '11', '--prefer-stable --ignore-platform-reqs'),
pipeline_postgres('8.1', 'pgsql', '11', '--prefer-stable --ignore-platform-reqs'),
pipeline_postgres('8.2', 'pgsql', '11', '--prefer-stable --ignore-platform-reqs'),
pipeline_sqlsrv('7.3', 'sqlsrv', '2017-latest', '--prefer-stable'),
pipeline_sqlsrv('7.4', 'sqlsrv', '2017-latest', '--prefer-stable'),
pipeline_sqlsrv('8.0', 'sqlsrv', '2017-latest', '--prefer-stable --ignore-platform-reqs'),
pipeline_sqlsrv('8.1', 'sqlsrv', '2017-latest', '--prefer-stable --ignore-platform-reqs'),
pipeline_sqlsrv('8.2', 'sqlsrv', '2017-latest', '--prefer-stable --ignore-platform-reqs'),
]