@@ -349,9 +349,16 @@ jobs:
349
349
fail-fast : false
350
350
matrix :
351
351
branch : ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
352
- name : " ${{ matrix.branch.name }}_COMMUNITY"
352
+ type : ['asan', 'verify_type_inference']
353
+ # These branches don't include type verification
354
+ exclude :
355
+ - { branch: { name: 'PHP-8.1', ref: 'PHP-8.1', major: 8, minor: 1 }, type: 'verify_type_inference' }
356
+ - { branch: { name: 'PHP-8.2', ref: 'PHP-8.2', major: 8, minor: 2 }, type: 'verify_type_inference' }
357
+ - { branch: { name: 'PHP-8.3', ref: 'PHP-8.3', major: 8, minor: 3 }, type: 'verify_type_inference' }
358
+ name : " ${{ matrix.branch.name }}_COMMUNITY_${{ matrix.type }}"
353
359
runs-on : ubuntu-${{ matrix.branch.version.minor >= 3 && '22.04' || '20.04' }}
354
360
env :
361
+ ASAN_OPTIONS : exitcode=139
355
362
UBSAN_OPTIONS : print_stacktrace=1
356
363
USE_ZEND_ALLOC : 0
357
364
USE_TRACKED_ALLOC : 1
@@ -365,11 +372,11 @@ jobs:
365
372
- name : ./configure
366
373
uses : ./.github/actions/configure-x64
367
374
with :
375
+ # CFLAGS removes O2, so we have to add it again...
368
376
configurationParameters : >-
369
- --enable-debug
370
377
--enable-zts
371
- CFLAGS='- fsanitize=undefined,address -fno-sanitize-recover -DZEND_TRACK_ARENA_ALLOC'
372
- LDFLAGS='-fsanitize=undefined,address'
378
+ ${{ matrix.type == 'asan' && '--enable-debug CFLAGS="- fsanitize=undefined,address -fno-sanitize-recover -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address"' || '' }}
379
+ ${{ matrix.type == 'verify_type_inference' && 'CFLAGS="-DZEND_VERIFY_TYPE_INFERENCE -O2"' || '' }}
373
380
- name : make
374
381
run : make -j$(/usr/bin/nproc) >/dev/null
375
382
- name : make install
@@ -379,12 +386,20 @@ jobs:
379
386
sudo service mysql start
380
387
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
381
388
mysql -uroot -proot -e "SET GLOBAL local_infile = true"
382
- - name : Enable Opcache and JIT
389
+ - name : Enable Opcache
383
390
run : |
391
+ echo memory_limit=-1 >> /etc/php.d/opcache.ini
384
392
echo zend_extension=opcache.so > /etc/php.d/opcache.ini
385
393
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
386
394
echo opcache.enable=1 >> /etc/php.d/opcache.ini
387
395
echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini
396
+ echo opcache.memory_consumption=256M >> /etc/php.d/opcache.ini
397
+ echo opcache.file_update_protection=0 >> /etc/php.d/opcache.ini
398
+ echo opcache.interned_strings_buffer=64 >> /etc/php.d/opcache.ini
399
+ echo opcache.max_accelerated_files=100000 >> /etc/php.d/opcache.ini
400
+ - name : Enable JIT
401
+ if : matrix.type != 'verify_type_inference'
402
+ run : |
388
403
echo opcache.jit=tracing >> /etc/php.d/opcache.ini
389
404
echo opcache.jit_buffer_size=1G >> /etc/php.d/opcache.ini
390
405
echo opcache.jit_max_root_traces=100000 >> /etc/php.d/opcache.ini
@@ -394,11 +409,6 @@ jobs:
394
409
echo opcache.jit_hot_func=1 >> /etc/php.d/opcache.ini
395
410
echo opcache.jit_hot_return=1 >> /etc/php.d/opcache.ini
396
411
echo opcache.jit_hot_side_exit=1 >> /etc/php.d/opcache.ini
397
- echo opcache.file_update_protection=0 >> /etc/php.d/opcache.ini
398
- echo opcache.memory_consumption=256M >> /etc/php.d/opcache.ini
399
- echo opcache.interned_strings_buffer=64 >> /etc/php.d/opcache.ini
400
- echo opcache.max_accelerated_files=100000 >> /etc/php.d/opcache.ini
401
- echo memory_limit=-1 >> /etc/php.d/opcache.ini
402
412
php -v
403
413
- name : Test AMPHP
404
414
run : |
@@ -410,7 +420,6 @@ jobs:
410
420
cd "amphp-$repository"
411
421
git rev-parse HEAD
412
422
php /usr/bin/composer install --no-progress --ignore-platform-reqs
413
- export ASAN_OPTIONS=exitcode=139
414
423
vendor/bin/phpunit || EXIT_CODE=$?
415
424
if [ ${EXIT_CODE:-0} -gt 128 ]; then
416
425
X=1;
@@ -426,7 +435,6 @@ jobs:
426
435
php /usr/bin/composer install --no-progress --ignore-platform-reqs
427
436
# Hack to disable a test that hangs
428
437
php -r '$c = file_get_contents("tests/Filesystem/FilesystemTest.php"); $c = str_replace("public function testSharedGet()", "#[\\PHPUnit\\Framework\\Attributes\\Group('"'"'skip'"'"')]\n public function testSharedGet()", $c); file_put_contents("tests/Filesystem/FilesystemTest.php", $c);'
429
- export ASAN_OPTIONS=exitcode=139
430
438
php vendor/bin/phpunit --exclude-group skip || EXIT_CODE=$?
431
439
if [ ${EXIT_CODE:-0} -gt 128 ]; then
432
440
exit 1
@@ -441,7 +449,6 @@ jobs:
441
449
cd "reactphp-$repository"
442
450
git rev-parse HEAD
443
451
php /usr/bin/composer install --no-progress --ignore-platform-reqs
444
- export ASAN_OPTIONS=exitcode=139
445
452
vendor/bin/phpunit || EXIT_CODE=$?
446
453
if [ $[EXIT_CODE:-0} -gt 128 ]; then
447
454
X=1;
@@ -455,7 +462,6 @@ jobs:
455
462
cd event-loop
456
463
git rev-parse HEAD
457
464
php /usr/bin/composer install --no-progress --ignore-platform-reqs
458
- export ASAN_OPTIONS=exitcode=139
459
465
vendor/bin/phpunit || EXIT_CODE=$?
460
466
if [ ${EXIT_CODE:-0} -gt 128 ]; then
461
467
exit 1
@@ -471,7 +477,6 @@ jobs:
471
477
php -r '$c = file_get_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php"); $c = str_replace("public function testSanitizeDeepNestedString()", "/** @group skip */\n public function testSanitizeDeepNestedString()", $c); file_put_contents("src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerCustomTest.php", $c);'
472
478
# Buggy FFI test in Symfony, see https://github.com/symfony/symfony/issues/47668
473
479
php -r '$c = file_get_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php"); $c = str_replace("*/\n public function testCastNonTrailingCharPointer()", "* @group skip\n */\n public function testCastNonTrailingCharPointer()", $c); file_put_contents("src/Symfony/Component/VarDumper/Tests/Caster/FFICasterTest.php", $c);'
474
- export ASAN_OPTIONS=exitcode=139
475
480
export SYMFONY_DEPRECATIONS_HELPER=max[total]=999
476
481
X=0
477
482
for component in $(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n'); do
@@ -487,7 +492,6 @@ jobs:
487
492
git clone https://github.com/sebastianbergmann/phpunit.git --branch=main --depth=1
488
493
cd phpunit
489
494
git rev-parse HEAD
490
- export ASAN_OPTIONS=exitcode=139
491
495
php /usr/bin/composer install --no-progress --ignore-platform-reqs
492
496
php ./phpunit || EXIT_CODE=$?
493
497
if [ ${EXIT_CODE:-0} -gt 128 ]; then
@@ -506,7 +510,6 @@ jobs:
506
510
git clone https://github.com/WordPress/wordpress-develop.git wordpress --depth=1
507
511
cd wordpress
508
512
git rev-parse HEAD
509
- export ASAN_OPTIONS=exitcode=139
510
513
php /usr/bin/composer install --no-progress --ignore-platform-reqs
511
514
cp wp-tests-config-sample.php wp-tests-config.php
512
515
sed -i 's/youremptytestdbnamehere/test/g' wp-tests-config.php
0 commit comments