4
4
pull_request :
5
5
6
6
jobs :
7
- static-analysis-phpstan :
8
- name : " Static Analysis with PHPStan "
7
+ coding-standards :
8
+ name : " Coding Standards "
9
9
runs-on : " ubuntu-latest"
10
10
11
11
strategy :
14
14
- " 7.4"
15
15
16
16
steps :
17
- - name : " Checkout code "
17
+ - name : " Checkout"
18
18
uses : " actions/checkout@v2"
19
19
20
20
- name : " Install PHP"
@@ -34,11 +34,14 @@ jobs:
34
34
- name : " Install dependencies with composer"
35
35
run : " composer install --no-interaction --no-progress --no-suggest"
36
36
37
- - name : " Run a static analysis with phpstan/phpstan "
38
- run : " composer phpstan -- --error -format=checkstyle | cs2pr"
37
+ - name : " Run PHP-CS-Fixer on src/ "
38
+ run : " vendor/bin/php-cs-fixer fix src/ --dry-run --stop-on-violation - -format=checkstyle | cs2pr"
39
39
40
- coding-standards :
41
- name : " Coding Standards"
40
+ - name : " Run PHP-CS-Fixer on tests/"
41
+ run : " vendor/bin/php-cs-fixer fix tests/ --dry-run --stop-on-violation --format=checkstyle | cs2pr"
42
+
43
+ require-checker :
44
+ name : " Composer require checker"
42
45
runs-on : " ubuntu-latest"
43
46
44
47
strategy :
@@ -67,14 +70,11 @@ jobs:
67
70
- name : " Install dependencies with composer"
68
71
run : " composer install --no-interaction --no-progress --no-suggest"
69
72
70
- - name : " Run PHP-CS-Fixer on src/"
71
- run : " vendor/bin/php-cs-fixer fix src/ --dry-run --stop-on-violation --report=checkstyle | cs2pr"
72
-
73
- - name : " Run PHP-CS-Fixer on tests/"
74
- run : " vendor/bin/php-cs-fixer fix tests/ --dry-run --stop-on-violation --report=checkstyle | cs2pr"
73
+ - name : " Run require-checker"
74
+ run : " composer require-checker"
75
75
76
76
phpunit-mysql57 :
77
- name : " PHPUnit on MySQL 5.7"
77
+ name : " PHPUnit on MySQL 5.7 and PhpStan "
78
78
runs-on : " ubuntu-latest"
79
79
80
80
strategy :
84
84
85
85
services :
86
86
mysql :
87
- image : " mysql: 5.7"
87
+ image : " mysql:5.7"
88
88
env :
89
89
MYSQL_ALLOW_EMPTY_PASSWORD : true
90
90
MYSQL_ROOT_PASSWORD :
99
99
uses : " shivammathur/setup-php@v2"
100
100
with :
101
101
php-version : " ${{ matrix.php-version }}"
102
- extensions : " oci8 "
102
+ extensions : " "
103
103
coverage : " pcov"
104
+ tools : " cs2pr"
104
105
105
106
- name : " Cache dependencies installed with composer"
106
107
uses : " actions/cache@v1"
@@ -113,13 +114,17 @@ jobs:
113
114
run : " composer install --no-interaction --no-progress --no-suggest"
114
115
115
116
- name : " Run PHPUnit"
116
- run : " vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover=coverage.xml"
117
+ run : " vendor/bin/phpunit -c phpunit.mysql8.xml --coverage-clover=coverage.xml"
117
118
118
119
- name : " Upload Code Coverage"
119
120
uses : " codecov/codecov-action@v1"
120
121
121
- phpunit-oci8 :
122
- name : " PHPUnit on OCI8"
122
+ # PHPStan is run after PHPUnit because we want to analyze the generated files too.
123
+ - name : " Run a static analysis with phpstan/phpstan"
124
+ run : " composer phpstan -- --error-format=checkstyle | cs2pr"
125
+
126
+ phpunit-mysql8 :
127
+ name : " PHPUnit on MySQL 8"
123
128
runs-on : " ubuntu-latest"
124
129
125
130
strategy :
@@ -128,10 +133,13 @@ jobs:
128
133
- " 7.4"
129
134
130
135
services :
131
- oracle :
132
- image : " wnameless/oracle-xe-11g-r2"
136
+ mysql :
137
+ image : " mysql:8"
138
+ env :
139
+ MYSQL_ALLOW_EMPTY_PASSWORD : true
140
+ MYSQL_ROOT_PASSWORD :
133
141
ports :
134
- - " 1521:1521 "
142
+ - " 3306:3306 "
135
143
136
144
steps :
137
145
- name : " Checkout"
@@ -141,7 +149,7 @@ jobs:
141
149
uses : " shivammathur/setup-php@v2"
142
150
with :
143
151
php-version : " ${{ matrix.php-version }}"
144
- extensions : " oci8 "
152
+ extensions : " "
145
153
coverage : " pcov"
146
154
147
155
- name : " Cache dependencies installed with composer"
@@ -155,7 +163,254 @@ jobs:
155
163
run : " composer install --no-interaction --no-progress --no-suggest"
156
164
157
165
- name : " Run PHPUnit"
158
- run : " vendor/bin/phpunit -c phpunit.oracle.xml --coverage-clover=coverage.xml"
166
+ run : " vendor/bin/phpunit -c phpunit.mysql8.xml --coverage-clover=coverage.xml"
167
+
168
+ - name : " Upload Code Coverage"
169
+ uses : " codecov/codecov-action@v1"
170
+
171
+ phpunit-prefer-lowest :
172
+ name : " PHPUnit with prefer-lowest"
173
+ runs-on : " ubuntu-latest"
174
+
175
+ strategy :
176
+ matrix :
177
+ php-version :
178
+ - " 7.4"
179
+
180
+ services :
181
+ mysql :
182
+ image : " mysql:8"
183
+ env :
184
+ MYSQL_ALLOW_EMPTY_PASSWORD : true
185
+ MYSQL_ROOT_PASSWORD :
186
+ ports :
187
+ - " 3306:3306"
188
+
189
+ steps :
190
+ - name : " Checkout"
191
+ uses : " actions/checkout@v2"
192
+
193
+ - name : " Install PHP"
194
+ uses : " shivammathur/setup-php@v2"
195
+ with :
196
+ php-version : " ${{ matrix.php-version }}"
197
+ extensions : " "
198
+ coverage : " pcov"
199
+
200
+ - name : " Cache dependencies installed with composer"
201
+ uses : " actions/cache@v1"
202
+ with :
203
+ path : " ~/.composer/cache"
204
+ key : " php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
205
+ restore-keys : " php-${{ matrix.php-version }}-composer-locked-"
206
+
207
+ - name : " Install dependencies with composer"
208
+ run : " composer update --no-interaction --no-progress --no-suggest --prefer-lowest"
209
+
210
+ - name : " Run PHPUnit"
211
+ run : " vendor/bin/phpunit -c phpunit.mysql8.xml --coverage-clover=coverage.xml"
159
212
160
213
- name : " Upload Code Coverage"
161
214
uses : " codecov/codecov-action@v1"
215
+
216
+ phpunit-mariadb105 :
217
+ name : " PHPUnit on MariaDB 10.5"
218
+ runs-on : " ubuntu-latest"
219
+
220
+ strategy :
221
+ matrix :
222
+ php-version :
223
+ - " 7.4"
224
+
225
+ services :
226
+ mysql :
227
+ image : " mariadb:10.5"
228
+ env :
229
+ MYSQL_ROOT_PASSWORD : root
230
+ ports :
231
+ - " 3306:3306"
232
+
233
+ steps :
234
+ - name : " Checkout"
235
+ uses : " actions/checkout@v2"
236
+
237
+ - name : " Install PHP"
238
+ uses : " shivammathur/setup-php@v2"
239
+ with :
240
+ php-version : " ${{ matrix.php-version }}"
241
+ extensions : " "
242
+ coverage : " pcov"
243
+
244
+ - name : " Cache dependencies installed with composer"
245
+ uses : " actions/cache@v1"
246
+ with :
247
+ path : " ~/.composer/cache"
248
+ key : " php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
249
+ restore-keys : " php-${{ matrix.php-version }}-composer-locked-"
250
+
251
+ - name : " Install dependencies with composer"
252
+ run : " composer install --no-interaction --no-progress --no-suggest"
253
+
254
+ - name : " Run PHPUnit"
255
+ run : " vendor/bin/phpunit -c phpunit.mariadb.xml --coverage-clover=coverage.xml"
256
+
257
+ - name : " Upload Code Coverage"
258
+ uses : " codecov/codecov-action@v1"
259
+
260
+ phpunit-postgresql :
261
+ name : " PHPUnit on PostgreSQL"
262
+ runs-on : " ubuntu-latest"
263
+
264
+ strategy :
265
+ matrix :
266
+ php-version :
267
+ - " 7.4"
268
+
269
+ services :
270
+ postgres :
271
+ image : postgres:12
272
+ env :
273
+ POSTGRES_PASSWORD : postgres
274
+ ports :
275
+ - " 5432:5432"
276
+ # Set health checks to wait until postgres has started
277
+ options : >-
278
+ --health-cmd pg_isready
279
+ --health-interval 10s
280
+ --health-timeout 5s
281
+ --health-retries 5
282
+ steps :
283
+ - name : " Checkout"
284
+ uses : " actions/checkout@v2"
285
+
286
+ - name : " Install PHP"
287
+ uses : " shivammathur/setup-php@v2"
288
+ with :
289
+ php-version : " ${{ matrix.php-version }}"
290
+ extensions : " pgsql"
291
+ coverage : " pcov"
292
+
293
+ - name : " Cache dependencies installed with composer"
294
+ uses : " actions/cache@v1"
295
+ with :
296
+ path : " ~/.composer/cache"
297
+ key : " php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
298
+ restore-keys : " php-${{ matrix.php-version }}-composer-locked-"
299
+
300
+ - name : " Install dependencies with composer"
301
+ run : " composer install --no-interaction --no-progress --no-suggest"
302
+
303
+ - name : " Run PHPUnit"
304
+ run : " vendor/bin/phpunit -c phpunit.postgres.github.xml --coverage-clover=coverage.xml"
305
+
306
+ - name : " Upload Code Coverage"
307
+ uses : " codecov/codecov-action@v1"
308
+
309
+ phpunit-phpbench :
310
+ name : " PHPBench"
311
+ runs-on : " ubuntu-latest"
312
+
313
+ strategy :
314
+ matrix :
315
+ php-version :
316
+ - " 7.4"
317
+
318
+ services :
319
+ mysql :
320
+ image : " mysql:8"
321
+ env :
322
+ MYSQL_ALLOW_EMPTY_PASSWORD : true
323
+ MYSQL_ROOT_PASSWORD :
324
+ ports :
325
+ - " 3306:3306"
326
+
327
+ steps :
328
+ - name : " Checkout"
329
+ uses : " actions/checkout@v2"
330
+ with :
331
+ fetch-depth : 0
332
+
333
+ - name : " Install PHP"
334
+ uses : " shivammathur/setup-php@v2"
335
+ with :
336
+ php-version : " ${{ matrix.php-version }}"
337
+ extensions : " "
338
+ coverage : " pcov"
339
+
340
+ - name : " Cache dependencies installed with composer"
341
+ uses : " actions/cache@v1"
342
+ with :
343
+ path : " ~/.composer/cache"
344
+ key : " php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
345
+ restore-keys : " php-${{ matrix.php-version }}-composer-locked-"
346
+
347
+ - name : " Install dependencies with composer"
348
+ run : " composer install --no-interaction --no-progress --no-suggest"
349
+
350
+ - name : " Running PHPBench on current branch"
351
+ run : " ./phpbench.dist.sh run --tag=current_pr --store"
352
+
353
+ - name : " Switching to master branch"
354
+ run : " git checkout master"
355
+
356
+ - name : " Updating dependencies"
357
+ run : " composer update"
358
+
359
+ - name : " Running PHPBENCH on master branch for comparison"
360
+ run : " ./phpbench.dist.sh run --tag=master --store"
361
+
362
+ - name : " Generating comparison"
363
+ run : " ./phpbench.dist.sh report --uuid=tag:current_pr --uuid=tag:master --report='{extends: compare, compare: tag}'"
364
+
365
+ # phpunit-oci8:
366
+ # name: "PHPUnit on OCI8"
367
+ # runs-on: "ubuntu-latest"
368
+ #
369
+ # strategy:
370
+ # matrix:
371
+ # php-version:
372
+ # - "7.4"
373
+ #
374
+ # services:
375
+ # oracle:
376
+ # image: "wnameless/oracle-xe-11g-r2"
377
+ # ports:
378
+ # - "1521:1521"
379
+ #
380
+ # steps:
381
+ # - name: "Checkout"
382
+ # uses: "actions/checkout@v2"
383
+ #
384
+ # - name: "Install PHP"
385
+ # uses: "shivammathur/setup-php@v2"
386
+ # with:
387
+ # php-version: "${{ matrix.php-version }}"
388
+ # extensions: "oci8"
389
+ # coverage: "pcov"
390
+ #
391
+ # - name: "Cache dependencies installed with composer"
392
+ # uses: "actions/cache@v1"
393
+ # with:
394
+ # path: "~/.composer/cache"
395
+ # key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
396
+ # restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
397
+ #
398
+ # - name: "Setup Oracle user"
399
+ # run: |
400
+ # docker exec $(docker ps -aqf "ancestor=wnameless/oracle-xe-11g-r2") bash -c "export PS1=1 && source /etc/bash.bashrc && source /root/.bashrc && sqlplus -L -S sys/oracle AS SYSDBA <<<SQL \
401
+ # create user tdbm_admin identified by tdbm quota unlimited on USERS default tablespace USERS; \
402
+ # GRANT CONNECT,RESOURCE TO tdbm_admin; \
403
+ # GRANT dba TO tdbm_admin WITH ADMIN OPTION; \
404
+ # grant create session, create procedure, create type, create table, create sequence, create view to tdbm_admin; \
405
+ # grant select any dictionary to tdbm_admin; \
406
+ # exit \
407
+ # SQL"
408
+ #
409
+ # - name: "Install dependencies with composer"
410
+ # run: "composer install --no-interaction --no-progress --no-suggest"
411
+ #
412
+ # - name: "Run PHPUnit"
413
+ # run: "vendor/bin/phpunit -c phpunit.oracle.xml --coverage-clover=coverage.xml"
414
+ #
415
+ # - name: "Upload Code Coverage"
416
+ # uses: "codecov/codecov-action@v1"
0 commit comments