1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 15:38:49 +02:00

Merge branch 'PHP-8.2'

* PHP-8.2:
  Migrate community job to GitHub actions
This commit is contained in:
Ilija Tovilo
2022-09-23 20:25:30 +02:00
3 changed files with 100 additions and 115 deletions
+100
View File
@@ -200,3 +200,103 @@ jobs:
- name: Upload Test Coverage to Codecov.io
if: always()
run: bash <(curl -s https://codecov.io/bash)
COMMUNITY:
needs: GENERATE_MATRIX
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
strategy:
fail-fast: false
matrix:
branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
name: "${{ matrix.branch.name }}_COMMUNITY"
runs-on: ubuntu-20.04
env:
UBSAN_OPTIONS: print_stacktrace=1
USE_ZEND_ALLOC: 0
USE_TRACKED_ALLOC: 1
steps:
- name: git checkout
uses: actions/checkout@v2
with:
ref: ${{ matrix.branch.ref }}
- name: apt
uses: ./.github/actions/apt-x64
- name: ./configure
uses: ./.github/actions/configure-x64
with:
configurationParameters: >-
--enable-debug
--enable-zts
--enable-address-sanitizer
--enable-undefined-sanitizer
CFLAGS='-DZEND_TRACK_ARENA_ALLOC -fno-sanitize-recover'
- name: make
run: make -j$(/usr/bin/nproc) >/dev/null
- name: make install
uses: ./.github/actions/install-linux
- name: Setup
run: |
sudo service mysql start
mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test"
mysql -uroot -proot -e "SET GLOBAL local_infile = true"
- name: Enable Opcache and JIT
run: |
echo zend_extension=opcache.so > /etc/php.d/opcache.ini
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini
echo opcache.jit_buffer_size=1G >> /etc/php.d/opcache.ini
- name: Test Laravel
if: always()
run: |
git clone https://github.com/laravel/framework.git --branch=master --depth=1
cd framework
git rev-parse HEAD
php /usr/bin/composer install --no-progress --ignore-platform-reqs
# Hack to disable a test that hangs
php -r '$c = file_get_contents("tests/Filesystem/FilesystemTest.php"); $c = str_replace("*/\n public function testSharedGet()", "* @group skip\n */\n public function testSharedGet()", $c); file_put_contents("tests/Filesystem/FilesystemTest.php", $c);'
export ASAN_OPTIONS=exitcode=139
php vendor/bin/phpunit --exclude-group skip || EXIT_CODE=$?
if [ $EXIT_CODE -gt 128 ]; then
exit 1
fi
- name: Test Symfony
if: always()
run: |
git clone https://github.com/symfony/symfony.git --depth=1
cd symfony
git rev-parse HEAD
php /usr/bin/composer install --no-progress --ignore-platform-reqs
php ./phpunit install
# Test causes a heap-buffer-overflow but I cannot reproduce it locally...
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);'
# Buggy FFI test in Symfony, see https://github.com/symfony/symfony/issues/47668
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);'
export ASAN_OPTIONS=exitcode=139
export SYMFONY_DEPRECATIONS_HELPER=max[total]=999
X=0
for component in $(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n'); do
php ./phpunit $component --exclude-group tty,benchmark,intl-data,transient --exclude-group skip || EXIT_CODE=$?
if [ $EXIT_CODE -gt 128 ]; then
X=1;
fi
done
exit $X
- name: Test PHPUnit
if: always()
run: |
git clone https://github.com/sebastianbergmann/phpunit.git --branch=main --depth=1
cd phpunit
git rev-parse HEAD
export ASAN_OPTIONS=exitcode=139
php /usr/bin/composer install --no-progress --ignore-platform-reqs
php ./phpunit || EXIT_CODE=$?
if [ $EXIT_CODE -gt 128 ]; then
exit 1
fi
- name: 'Symfony Preloading'
if: always()
run: |
php /usr/bin/composer create-project symfony/symfony-demo symfony_demo --no-progress --ignore-platform-reqs
cd symfony_demo
git rev-parse HEAD
sed -i 's/PHP_SAPI/"cli-server"/g' var/cache/dev/App_KernelDevDebugContainer.preload.php
php -d opcache.preload=var/cache/dev/App_KernelDevDebugContainer.preload.php public/index.php
-7
View File
@@ -52,13 +52,6 @@ jobs:
configurationParameters: '--enable-debug --enable-zts'
runTestsParameters: --msan
timeoutInMinutes: 90
- template: azure/community_job.yml
parameters:
configurationName: COMMUNITY
configurationParameters: >-
--enable-debug --enable-zts --enable-address-sanitizer --enable-undefined-sanitizer
CFLAGS='-fno-sanitize-recover'
timeoutInMinutes: 90
- template: azure/opcache_variation_job.yml
parameters:
configurationName: DEBUG_NTS_OPCACHE
-108
View File
@@ -1,108 +0,0 @@
parameters:
configurationName: ''
configurationParameters: ''
timeoutInMinutes: 60
# The purpose of the job is to test open-source community projects against an aggressive
# debug build, that enables assertions, as well as the address and UB sanitizers. However,
# we are only interested in finding assertion failures, segfaults and sanitizer violations,
# and don't care about the actual test results, as there will commonly be failures for
# pre-release versions of PHP.
#
# Because exit() in PHP results in an unclean shutdown, test runs are patching phpunit to
# avoid the exit, which allows us to also check for memory leaks. Otherwise we use
# USE_TRACKED_ALLOC=1 to avoid reporting of leaks that will be handled by ZMM.
jobs:
- job: ${{ parameters.configurationName }}
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
pool:
vmImage: 'ubuntu-20.04'
variables:
ubsan_options: 'print_stacktrace=1'
steps:
- template: apt.yml
- template: configure.yml
parameters:
configurationParameters: ${{ parameters.configurationParameters }}
- script: make -j$(/usr/bin/nproc) >/dev/null
displayName: 'Make Build'
- script: |
sudo make install
sudo mkdir /etc/php.d
sudo chmod 777 /etc/php.d
echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini
echo pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/pdo_mysql.ini
# Run with opcache to also catch optimizer bugs.
echo zend_extension=opcache.so > /etc/php.d/opcache.ini
echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini
echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini
echo opcache.jit_buffer_size=1G >> /etc/php.d/opcache.ini
displayName: 'Install Build'
- script: |
git clone https://github.com/laravel/framework.git --branch=master --depth=1
cd framework
git rev-parse HEAD
php8.0 /usr/bin/composer install --no-progress
# Hack to disable a test that hangs on azure
sed -i 's/PHP_OS/"Darwin"/' tests/Filesystem/FilesystemTest.php
export USE_ZEND_ALLOC=0
export ASAN_OPTIONS=exitcode=139
php vendor/bin/phpunit
if [ $? -gt 128 ]; then
exit 1
fi
displayName: 'Test Laravel'
- script: |
git clone https://github.com/symfony/symfony.git --depth=1
cd symfony
git rev-parse HEAD
php8.0 /usr/bin/composer install --no-progress
php8.0 ./phpunit install
export USE_ZEND_ALLOC=0
export USE_TRACKED_ALLOC=1
export ASAN_OPTIONS=exitcode=139
export SYMFONY_DEPRECATIONS_HELPER=max[total]=999
X=0
for component in $(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n'); do
php ./phpunit $component --exclude-group tty,benchmark,intl-data,transient;
if [ $? -gt 128 ]; then
X=1;
fi
done
exit $X
displayName: 'Test Symfony'
condition: or(succeeded(), failed())
- script: |
git clone https://github.com/amphp/amp.git --branch=master --depth=1
cd amp
git rev-parse HEAD
php /usr/bin/composer install --no-progress --ignore-platform-reqs
export USE_ZEND_ALLOC=0
sed -i 's/$exit = true/$exit = false/g' vendor/phpunit/phpunit/src/TextUI/Command.php
php vendor/bin/phpunit
displayName: 'Test Amphp'
condition: or(succeeded(), failed())
- script: |
git clone https://github.com/sebastianbergmann/phpunit.git --branch=master --depth=1
cd phpunit
git rev-parse HEAD
export USE_ZEND_ALLOC=0
export USE_TRACKED_ALLOC=1
export ASAN_OPTIONS=exitcode=139
php8.0 /usr/bin/composer install --no-progress
php ./phpunit
if [ $? -gt 128 ]; then
exit 1
fi
displayName: 'Test PHPUnit'
condition: or(succeeded(), failed())
- script: |
php8.0 /usr/bin/composer create-project symfony/symfony-demo symfony_demo --no-progress
cd symfony_demo
git rev-parse HEAD
export USE_ZEND_ALLOC=0
export USE_TRACKED_ALLOC=1
sed -i 's/PHP_SAPI/"cli-server"/g' var/cache/dev/App_KernelDevDebugContainer.preload.php
php -d opcache.preload=var/cache/dev/App_KernelDevDebugContainer.preload.php public/index.php
displayName: 'Symfony Preloading'
condition: or(succeeded(), failed())