@@ -46,16 +46,16 @@ jobs:
46
46
47
47
- name : Install PHP dependencies
48
48
run : |
49
- if [ "${{ matrix.type }}" != "Phpunit" ] && [ "${{ matrix.type }}" != "StaticAnalysis" ]; then composer remove --no-interaction --no-update phpunit/phpunit johnkary/ phpunit-speedtrap --dev; fi
50
- if [ "${{ matrix.type }}" != "CodingStyle" ]; then composer remove --no-interaction --no-update friendsofphp/php-cs-fixer --dev; fi
49
+ if [ "${{ matrix.type }}" != "Phpunit" ] && [ "${{ matrix.type }}" != "StaticAnalysis" ]; then composer remove --no-interaction --no-update phpunit/phpunit atk4/ergebnis- phpunit-slow-test-detector --dev; fi
50
+ if [ "${{ matrix.type }}" != "CodingStyle" ]; then composer remove --no-interaction --no-update friendsofphp/php-cs-fixer ergebnis/composer-normalize --dev; fi
51
51
if [ "${{ matrix.type }}" != "StaticAnalysis" ]; then composer remove --no-interaction --no-update phpstan/\* behat/\* --dev; fi
52
52
composer update --ansi --prefer-dist --no-interaction --no-progress --optimize-autoloader
53
53
54
54
- name : " Run tests: SQLite (only for Phpunit)"
55
55
if : startsWith(matrix.type, 'Phpunit')
56
56
run : |
57
57
php demos/_demo-data/create-db.php
58
- vendor/bin/phpunit --exclude-group none --no-coverage -v
58
+ vendor/bin/phpunit --exclude-group none --no-coverage --fail-on-warning --fail-on-risky $(if vendor/bin/phpunit --version | grep -q '^PHPUnit 9\.'; then echo -v; else echo --fail-on-notice --fail-on-deprecation --display-notices --display-deprecations --display-warnings --display-errors --display-incomplete --display-skipped; fi)
59
59
60
60
- name : Check Coding Style (only for CodingStyle)
61
61
if : matrix.type == 'CodingStyle'
@@ -133,13 +133,13 @@ jobs:
133
133
134
134
- name : Install PHP dependencies
135
135
run : |
136
- if [ "${{ matrix.type }}" != "Phpunit" ] && [ "${{ matrix.type }}" != "Phpunit Lowest" ] && [ "${{ matrix.type }}" != "Phpunit Burn" ]; then composer remove --no-interaction --no-update phpunit/phpunit johnkary/ phpunit-speedtrap --dev; fi
137
- if [ "${{ matrix.type }}" != "CodingStyle" ]; then composer remove --no-interaction --no-update friendsofphp/php-cs-fixer --dev; fi
136
+ if [ "${{ matrix.type }}" != "Phpunit" ] && [ "${{ matrix.type }}" != "Phpunit Lowest" ] && [ "${{ matrix.type }}" != "Phpunit Burn" ]; then composer remove --no-interaction --no-update phpunit/phpunit atk4/ergebnis- phpunit-slow-test-detector --dev; fi
137
+ if [ "${{ matrix.type }}" != "CodingStyle" ]; then composer remove --no-interaction --no-update friendsofphp/php-cs-fixer ergebnis/composer-normalize --dev; fi
138
138
if [ "${{ matrix.type }}" != "StaticAnalysis" ]; then composer remove --no-interaction --no-update phpstan/\* behat/\* --dev; fi
139
139
if [ -n "$LOG_COVERAGE" ]; then composer require --no-interaction --no-install phpunit/phpcov; fi
140
140
composer update --ansi --prefer-dist --no-interaction --no-progress --optimize-autoloader
141
141
if [ "${{ matrix.type }}" = "Phpunit Lowest" ]; then composer update --ansi --prefer-dist --prefer-lowest --prefer-stable --no-interaction --no-progress --optimize-autoloader; fi
142
- if [ "${{ matrix.type }}" = "Phpunit Burn" ]; then sed -i 's~ * public function runBare(): void~public function runBare(): void { gc_collect_cycles(); gc_collect_cycles(); $memDiffs = array_fill(0, '"$(if [ \"$GITHUB_EVENT_NAME\" == \"schedule\" ]; then echo 64; else echo 16; fi)"', 0); for ($i = -1; $i < count($memDiffs); ++$i) { $this->_runBare(); gc_collect_cycles(); gc_collect_cycles(); $mem = memory_get_usage(); if ($i !== -1) { $memDiffs[$i] = $mem - $memPrev; } $memPrev = $mem; rsort($memDiffs); if (array_sum($memDiffs) >= 4096 * 1024 || $memDiffs[2] > 0) { $this->onNotSuccessfulTest(new AssertionFailedError("Memory leak detected! (" . implode(" + ", array_map(static fn ($v) => number_format($v / 1024, 3, ".", " "), array_filter($memDiffs))) . " KB, " . ($i + 2) . " iterations)")); } } } private function _runBare(): void~' vendor/phpunit/phpunit/src/Framework/TestCase.php && cat vendor/phpunit/phpunit/src/Framework/TestCase.php | grep '_runBare('; fi
142
+ if [ "${{ matrix.type }}" = "Phpunit Burn" ]; then sed -i 's~public function runBare(): void~public function runBare(): void { gc_collect_cycles(); gc_collect_cycles(); $memDiffs = array_fill(0, '"$(if [ \"$GITHUB_EVENT_NAME\" == \"schedule\" ]; then echo 64; else echo 16; fi)"', 0); for ($i = -1; $i < count($memDiffs); ++$i) { $this->_runBare(); gc_collect_cycles(); gc_collect_cycles(); $mem = memory_get_usage(); if ($i !== -1) { $memDiffs[$i] = $mem - $memPrev; } $memPrev = $mem; rsort($memDiffs); if (array_sum($memDiffs) >= 4096 * 1024 || $memDiffs[2] > 0) { $this->onNotSuccessfulTest(new AssertionFailedError("Memory leak detected! (" . implode(" + ", array_map(static fn ($v) => number_format($v / 1024, 3, ".", " "), array_filter($memDiffs))) . " KB, " . ($i + 2) . " iterations)")); } } } private function _runBare(): void~' vendor/phpunit/phpunit/src/Framework/TestCase.php && cat vendor/phpunit/phpunit/src/Framework/TestCase.php | grep '_runBare('; fi
143
143
144
144
- name : Init
145
145
run : |
@@ -152,31 +152,31 @@ jobs:
152
152
- name : " Run tests: SQLite"
153
153
run : |
154
154
php demos/_demo-data/create-db.php
155
- php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) -v
155
+ php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) --fail-on-warning --fail-on-risky $(if vendor/bin/phpunit --version | grep -q '^PHPUnit 9\.'; then echo -v; else echo --fail-on-notice --fail-on-deprecation --display-notices --display-deprecations --display-warnings --display-errors --display-incomplete --display-skipped; fi)
156
156
if [ -n "$LOG_COVERAGE" ]; then mv coverage/phpunit.cov coverage/phpunit-sqlite.cov; fi
157
157
158
- - name : " Run tests: MySQL"
159
- if : success() || failure()
158
+ - name : " Run tests: MySQL (only for cron) "
159
+ if : ( success() || failure()) && github.event_name == 'schedule'
160
160
env :
161
161
DB_DSN : " mysql:host=mysql;dbname=atk4_test"
162
162
DB_USER : atk4_test_user
163
163
DB_PASSWORD : atk4_pass
164
164
run : |
165
165
sed -E "s~(\\\$db = new.+Persistence\\\\Sql)\(.+\);~\\1('$DB_DSN', '$DB_USER', '$DB_PASSWORD');~g" -i demos/db.default.php
166
166
php demos/_demo-data/create-db.php
167
- php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) -v
167
+ php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) --fail-on-warning --fail-on-risky $(if vendor/bin/phpunit --version | grep -q '^PHPUnit 9\.'; then echo -v; else echo --fail-on-notice --fail-on-deprecation --display-notices --display-deprecations --display-warnings --display-errors --display-incomplete --display-skipped; fi)
168
168
if [ -n "$LOG_COVERAGE" ]; then mv coverage/phpunit.cov coverage/phpunit-mysql.cov; fi
169
169
170
- - name : " Run tests: MariaDB (only for cron) "
171
- if : ( success() || failure()) && github.event_name == 'schedule'
170
+ - name : " Run tests: MariaDB"
171
+ if : success() || failure()
172
172
env :
173
173
DB_DSN : " mysql:host=mariadb;dbname=atk4_test"
174
174
DB_USER : atk4_test_user
175
175
DB_PASSWORD : atk4_pass
176
176
run : |
177
177
sed -E "s~(\\\$db = new.+Persistence\\\\Sql)\(.+\);~\\1('$DB_DSN', '$DB_USER', '$DB_PASSWORD');~g" -i demos/db.default.php
178
178
php demos/_demo-data/create-db.php
179
- php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) -v
179
+ php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) --fail-on-warning --fail-on-risky $(if vendor/bin/phpunit --version | grep -q '^PHPUnit 9\.'; then echo -v; else echo --fail-on-notice --fail-on-deprecation --display-notices --display-deprecations --display-warnings --display-errors --display-incomplete --display-skipped; fi)
180
180
if [ -n "$LOG_COVERAGE" ]; then mv coverage/phpunit.cov coverage/phpunit-mariadb.cov; fi
181
181
182
182
- name : " Run tests: PostgreSQL (only for cron)"
@@ -188,7 +188,7 @@ jobs:
188
188
run : |
189
189
sed -E "s~(\\\$db = new.+Persistence\\\\Sql)\(.+\);~\\1('$DB_DSN', '$DB_USER', '$DB_PASSWORD');~g" -i demos/db.default.php
190
190
php demos/_demo-data/create-db.php
191
- php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) -v
191
+ php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) --fail-on-warning --fail-on-risky $(if vendor/bin/phpunit --version | grep -q '^PHPUnit 9\.'; then echo -v; else echo --fail-on-notice --fail-on-deprecation --display-notices --display-deprecations --display-warnings --display-errors --display-incomplete --display-skipped; fi)
192
192
if [ -n "$LOG_COVERAGE" ]; then mv coverage/phpunit.cov coverage/phpunit-postgres.cov; fi
193
193
194
194
- name : " Run tests: MSSQL (only for cron)"
@@ -200,20 +200,20 @@ jobs:
200
200
run : |
201
201
sed -E "s~(\\\$db = new.+Persistence\\\\Sql)\(.+\);~\\1('$DB_DSN', '$DB_USER', '$DB_PASSWORD');~g" -i demos/db.default.php
202
202
php demos/_demo-data/create-db.php
203
- php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) -v
203
+ php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) --fail-on-warning --fail-on-risky $(if vendor/bin/phpunit --version | grep -q '^PHPUnit 9\.'; then echo -v; else echo --fail-on-notice --fail-on-deprecation --display-notices --display-deprecations --display-warnings --display-errors --display-incomplete --display-skipped; fi)
204
204
if [ -n "$LOG_COVERAGE" ]; then mv coverage/phpunit.cov coverage/phpunit-mssql.cov; fi
205
205
206
206
- name : " Run tests: Oracle (only for cron)"
207
207
if : (success() || failure()) && github.event_name == 'schedule'
208
208
env :
209
- DB_DSN : " oci:dbname=oracle/xe "
209
+ DB_DSN : " oci:dbname=oracle/free "
210
210
DB_USER : system
211
211
DB_PASSWORD : atk4_pass
212
212
NLS_LANG : AMERICAN_AMERICA.AL32UTF8
213
213
run : |
214
214
sed -E "s~(\\\$db = new.+Persistence\\\\Sql)\(.+\);~\\1('$DB_DSN', '$DB_USER', '$DB_PASSWORD');~g" -i demos/db.default.php
215
215
php demos/_demo-data/create-db.php
216
- php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) -v
216
+ php -d opcache.enable_cli=1 vendor/bin/phpunit --exclude-group none $(if [ -n "$LOG_COVERAGE" ]; then echo --coverage-text; else echo --no-coverage; fi) --fail-on-warning --fail-on-risky $(if vendor/bin/phpunit --version | grep -q '^PHPUnit 9\.'; then echo -v; else echo --fail-on-notice --fail-on-deprecation --display-notices --display-deprecations --display-warnings --display-errors --display-incomplete --display-skipped; fi)
217
217
if [ -n "$LOG_COVERAGE" ]; then mv coverage/phpunit.cov coverage/phpunit-oracle.cov; fi
218
218
219
219
- name : Upload coverage logs 1/2 (only for latest Phpunit)
@@ -353,8 +353,8 @@ jobs:
353
353
354
354
- name : Install PHP dependencies
355
355
run : |
356
- composer remove --no-interaction --no-update phpunit/phpunit johnkary/ phpunit-speedtrap --dev
357
- composer remove --no-interaction --no-update friendsofphp/php-cs-fixer --dev
356
+ composer remove --no-interaction --no-update phpunit/phpunit atk4/ergebnis- phpunit-slow-test-detector --dev
357
+ composer remove --no-interaction --no-update friendsofphp/php-cs-fixer ergebnis/composer-normalize --dev
358
358
composer remove --no-interaction --no-update phpstan/\* --dev
359
359
if [ -n "$LOG_COVERAGE" ]; then composer require --no-interaction --no-install phpunit/phpcov; fi
360
360
composer update --ansi --prefer-dist --no-interaction --no-progress --optimize-autoloader
@@ -383,8 +383,8 @@ jobs:
383
383
php demos/_demo-data/create-db.php
384
384
vendor/bin/behat -vv --config behat.yml.dist
385
385
386
- - name : " Run tests: MySQL (only for coverage or cron)"
387
- if : (success() || failure()) && (env.LOG_COVERAGE || github.event_name == 'schedule')
386
+ - name : " Run tests: MySQL (only for cron)"
387
+ if : (success() || failure()) && github.event_name == 'schedule'
388
388
env :
389
389
DB_DSN : " mysql:host=mysql;dbname=atk4_test"
390
390
DB_USER : atk4_test_user
@@ -394,8 +394,8 @@ jobs:
394
394
php demos/_demo-data/create-db.php
395
395
vendor/bin/behat -vv --config behat.yml.dist
396
396
397
- - name : " Run tests: MariaDB (only for cron)"
398
- if : (success() || failure()) && github.event_name == 'schedule'
397
+ - name : " Run tests: MariaDB (only for coverage or cron)"
398
+ if : (success() || failure()) && (env.LOG_COVERAGE || github.event_name == 'schedule')
399
399
env :
400
400
DB_DSN : " mysql:host=mariadb;dbname=atk4_test"
401
401
DB_USER : atk4_test_user
@@ -430,7 +430,7 @@ jobs:
430
430
- name : " Run tests: Oracle (only for cron)"
431
431
if : (success() || failure()) && github.event_name == 'schedule'
432
432
env :
433
- DB_DSN : " oci:dbname=oracle/xe "
433
+ DB_DSN : " oci:dbname=oracle/free "
434
434
DB_USER : system
435
435
DB_PASSWORD : atk4_pass
436
436
NLS_LANG : AMERICAN_AMERICA.AL32UTF8
0 commit comments