From b7020238769321ff376e9caaf0a1d4ed43de8509 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 9 Feb 2022 19:01:05 +0100 Subject: [PATCH 1/7] Migrate CI to GitHub actions --- .github/actions/apt-i386/action.yml | 45 ++++ .github/actions/apt-x64/action.yml | 65 ++++++ .github/actions/brew/action.yml | 31 +++ .github/actions/configure-i386/action.yml | 68 ++++++ .github/actions/configure-macos/action.yml | 70 +++++++ .github/actions/configure-x64/action.yml | 83 ++++++++ .github/actions/install-linux/action.yml | 14 ++ .github/actions/mssql/action.yml | 13 ++ .github/actions/setup-i386/action.yml | 11 + .github/actions/setup-x64/action.yml | 31 +++ .github/actions/test-linux/action.yml | 27 +++ .github/actions/test-macos/action.yml | 20 ++ .github/matrix.php | 229 +++++++++++++++++++++ .github/scripts/setup-slapd.sh | 185 +++++++++++++++++ .github/workflows/push.yml | 30 +++ 15 files changed, 922 insertions(+) create mode 100644 .github/actions/apt-i386/action.yml create mode 100644 .github/actions/apt-x64/action.yml create mode 100644 .github/actions/brew/action.yml create mode 100644 .github/actions/configure-i386/action.yml create mode 100644 .github/actions/configure-macos/action.yml create mode 100644 .github/actions/configure-x64/action.yml create mode 100644 .github/actions/install-linux/action.yml create mode 100644 .github/actions/mssql/action.yml create mode 100644 .github/actions/setup-i386/action.yml create mode 100644 .github/actions/setup-x64/action.yml create mode 100644 .github/actions/test-linux/action.yml create mode 100644 .github/actions/test-macos/action.yml create mode 100644 .github/matrix.php create mode 100755 .github/scripts/setup-slapd.sh create mode 100644 .github/workflows/push.yml diff --git a/.github/actions/apt-i386/action.yml b/.github/actions/apt-i386/action.yml new file mode 100644 index 0000000000000..44768cf5c6e52 --- /dev/null +++ b/.github/actions/apt-i386/action.yml @@ -0,0 +1,45 @@ +name: apt +runs: + using: composite + steps: + - shell: bash + run: | + sudo dpkg --add-architecture i386 + sudo apt-get update -y | true + sudo apt-get install -y gcc-multilib + sudo apt-get install -y g++-multilib + sudo apt-get purge -y libxml2 + # TODO: Reenable postgresql + postgresql-contrib packages once they work again. + sudo apt-get purge -y libpq5 + sudo apt-get install -y libc6:i386 + sudo apt-get install -y bison \ + re2c \ + locales \ + language-pack-de \ + libssl-dev:i386 \ + zlib1g-dev:i386 \ + libxml2-dev:i386 \ + libgmp-dev:i386 \ + libicu-dev:i386 \ + libtidy-dev:i386 \ + libaspell-dev:i386 \ + libpspell-dev:i386 \ + libsasl2-dev:i386 \ + libxpm-dev:i386 \ + libjpeg-dev:i386 \ + libpng-dev:i386 \ + libzip-dev:i386 \ + libbz2-dev:i386 \ + libsqlite3-dev:i386 \ + libwebp-dev:i386 \ + libonig-dev:i386 \ + libkrb5-dev:i386 \ + libgssapi-krb5-2:i386 \ + libcurl4-openssl-dev:i386 \ + libxml2-dev:i386 \ + libxslt1-dev:i386 \ + libpq-dev:i386 \ + libreadline-dev:i386 \ + libffi-dev:i386 \ + libfreetype6-dev:i386 \ + libsodium-dev:i386 diff --git a/.github/actions/apt-x64/action.yml b/.github/actions/apt-x64/action.yml new file mode 100644 index 0000000000000..aa7965cb30384 --- /dev/null +++ b/.github/actions/apt-x64/action.yml @@ -0,0 +1,65 @@ +name: apt +runs: + using: composite + steps: + - shell: bash + run: | + sudo apt install bison \ + re2c \ + locales \ + ldap-utils \ + openssl \ + slapd \ + language-pack-de \ + libgmp-dev \ + libicu-dev \ + libtidy-dev \ + libenchant-dev \ + libaspell-dev \ + libpspell-dev \ + libsasl2-dev \ + libxpm-dev \ + libzip-dev \ + libsqlite3-dev \ + libwebp-dev \ + libonig-dev \ + libkrb5-dev \ + libgssapi-krb5-2 \ + libcurl4-openssl-dev \ + libxml2-dev \ + libxslt1-dev \ + libpq-dev \ + libreadline-dev \ + libldap2-dev \ + libsodium-dev \ + libargon2-0-dev \ + libmm-dev \ + libsnmp-dev \ + postgresql \ + postgresql-contrib \ + snmpd \ + snmp-mibs-downloader \ + freetds-dev \ + unixodbc-dev \ + llvm \ + libc-client-dev \ + dovecot-core \ + dovecot-pop3d \ + dovecot-imapd \ + sendmail \ + firebird-dev \ + liblmdb-dev \ + libtokyocabinet-dev \ + libdb-dev \ + libqdbm-dev \ + libjpeg-dev \ + libpng-dev \ + libfreetype6-dev + mkdir /opt/oracle + wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip + unzip instantclient-basiclite-linuxx64.zip + wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linuxx64.zip + unzip instantclient-sdk-linuxx64.zip + mv instantclient_*_* /opt/oracle/instantclient + # Interferes with libldap2 headers. + rm /opt/oracle/instantclient/sdk/include/ldap.h diff --git a/.github/actions/brew/action.yml b/.github/actions/brew/action.yml new file mode 100644 index 0000000000000..3b4fcf18b0efe --- /dev/null +++ b/.github/actions/brew/action.yml @@ -0,0 +1,31 @@ +name: brew +runs: + using: composite + steps: + - shell: bash + run: | + brew install pkg-config \ + autoconf \ + bison \ + re2c + brew install openssl@1.1 \ + krb5 \ + bzip2 \ + enchant \ + libffi \ + libpng \ + webp \ + freetype \ + intltool \ + icu4c \ + libiconv \ + zlib \ + t1lib \ + gd \ + libzip \ + gmp \ + tidyp \ + libxml2 \ + libxslt \ + postgresql + brew link icu4c gettext --force diff --git a/.github/actions/configure-i386/action.yml b/.github/actions/configure-i386/action.yml new file mode 100644 index 0000000000000..0e1686d6b848b --- /dev/null +++ b/.github/actions/configure-i386/action.yml @@ -0,0 +1,68 @@ +name: ./configure +inputs: + configurationParameters: + default: '' + required: false +runs: + using: composite + steps: + - shell: bash + run: | + ./buildconf --force + export CFLAGS="-m32 -msse2" + export CXXFLAGS="-m32 -msse2" + export LDFLAGS=-L/usr/lib/i386-linux-gnu + export PKG_CONFIG=/usr/bin/i686-linux-gnu-pkg-config + ./configure \ + --enable-option-checking=fatal \ + --build=i686-pc-linux-gnu \ + --prefix=/usr \ + --enable-phpdbg \ + --enable-fpm \ + --enable-intl \ + --with-pdo-mysql=mysqlnd \ + --with-mysqli=mysqlnd \ + --with-pgsql \ + --with-pdo-pgsql \ + --with-pdo-sqlite \ + --without-pear \ + --enable-gd \ + --with-jpeg \ + --with-webp \ + --with-freetype \ + --with-xpm \ + --enable-exif \ + --with-zip \ + --with-zlib \ + --with-zlib-dir=/usr \ + --enable-soap \ + --enable-xmlreader \ + --with-xsl \ + --with-tidy \ + --enable-sysvsem \ + --enable-sysvshm \ + --enable-shmop \ + --enable-pcntl \ + --with-readline \ + --enable-mbstring \ + --with-curl \ + --with-gettext \ + --enable-sockets \ + --with-bz2 \ + --with-openssl \ + --with-gmp \ + --enable-bcmath \ + --enable-calendar \ + --enable-ftp \ + --with-pspell=/usr \ + --with-kerberos \ + --enable-sysvmsg \ + --with-ffi \ + --enable-zend-test \ + --with-mhash \ + --with-sodium \ + --enable-dba \ + --enable-werror \ + --with-config-file-path=/etc \ + --with-config-file-scan-dir=/etc/php.d \ + ${{ inputs.configurationParameters }} diff --git a/.github/actions/configure-macos/action.yml b/.github/actions/configure-macos/action.yml new file mode 100644 index 0000000000000..f99fa4f5c3ac5 --- /dev/null +++ b/.github/actions/configure-macos/action.yml @@ -0,0 +1,70 @@ +name: ./configure +inputs: + configurationParameters: + default: '' + required: false +runs: + using: composite + steps: + - shell: bash + run: | + export PATH="/usr/local/opt/bison/bin:$PATH" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/openssl@1.1/lib/pkgconfig" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/krb5/lib/pkgconfig" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libffi/lib/pkgconfig" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libxml2/lib/pkgconfig" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libxslt/lib/pkgconfig" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/zlib/lib/pkgconfig" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/icu4c/lib/pkgconfig" + ./buildconf --force + ./configure \ + --enable-option-checking=fatal \ + --prefix=/usr/local \ + --enable-fpm \ + --with-pdo-mysql=mysqlnd \ + --with-mysqli=mysqlnd \ + --with-pgsql=/usr/local/opt/libpq \ + --with-pdo-pgsql=/usr/local/opt/libpq \ + --with-pdo-sqlite \ + --without-pear \ + --enable-gd \ + --with-jpeg \ + --with-webp \ + --with-freetype \ + --enable-exif \ + --with-zip \ + --with-zlib \ + --enable-soap \ + --enable-xmlreader \ + --with-xsl \ + --with-tidy=/usr/local/opt/tidyp \ + --with-libxml \ + --enable-sysvsem \ + --enable-sysvshm \ + --enable-shmop \ + --enable-pcntl \ + --with-readline=/usr/local/opt/readline \ + --enable-mbstring \ + --with-curl \ + --with-gettext=/usr/local/opt/gettext \ + --enable-sockets \ + --with-bz2=/usr/local/opt/bzip2 \ + --with-openssl \ + --with-gmp=/usr/local/opt/gmp \ + --with-iconv=/usr/local/opt/libiconv \ + --enable-bcmath \ + --enable-calendar \ + --enable-ftp \ + --with-pspell=/usr/local/opt/aspell \ + --with-kerberos \ + --enable-sysvmsg \ + --with-ffi \ + --enable-zend-test \ + --enable-intl \ + --with-mhash \ + --with-sodium \ + --enable-dba \ + --enable-werror \ + --with-config-file-path=/etc \ + --with-config-file-scan-dir=/etc/php.d \ + ${{ inputs.configurationParameters }} diff --git a/.github/actions/configure-x64/action.yml b/.github/actions/configure-x64/action.yml new file mode 100644 index 0000000000000..2283ccee42158 --- /dev/null +++ b/.github/actions/configure-x64/action.yml @@ -0,0 +1,83 @@ +name: ./configure +inputs: + configurationParameters: + default: '' + required: false +runs: + using: composite + steps: + - shell: bash + run: | + ./buildconf --force + ./configure \ + --enable-option-checking=fatal \ + --prefix=/usr \ + --enable-phpdbg \ + --enable-fpm \ + --with-pdo-mysql=mysqlnd \ + --with-mysqli=mysqlnd \ + --with-pgsql \ + --with-pdo-pgsql \ + --with-pdo-sqlite \ + --enable-intl \ + --without-pear \ + --enable-gd \ + --with-jpeg \ + --with-webp \ + --with-freetype \ + --with-xpm \ + --enable-exif \ + --with-zip \ + --with-zlib \ + --with-zlib-dir=/usr \ + --enable-soap \ + --enable-xmlreader \ + --with-xsl \ + --with-tidy \ + --enable-sysvsem \ + --enable-sysvshm \ + --enable-shmop \ + --enable-pcntl \ + --with-readline \ + --enable-mbstring \ + --with-curl \ + --with-gettext \ + --enable-sockets \ + --with-bz2 \ + --with-openssl \ + --with-gmp \ + --enable-bcmath \ + --enable-calendar \ + --enable-ftp \ + --with-pspell=/usr \ + --with-enchant=/usr \ + --with-kerberos \ + --enable-sysvmsg \ + --with-ffi \ + --enable-zend-test \ + --with-ldap \ + --with-ldap-sasl \ + --with-password-argon2 \ + --with-mhash \ + --with-sodium \ + --enable-dba \ + --with-cdb \ + --enable-flatfile \ + --enable-inifile \ + --with-tcadb \ + --with-lmdb \ + --with-qdbm \ + --with-snmp \ + --with-unixODBC \ + --with-imap \ + --with-kerberos \ + --with-imap-ssl \ + --with-pdo-odbc=unixODBC,/usr \ + --with-pdo-firebird \ + --with-pdo-dblib \ + --with-pdo-oci=shared,instantclient,/opt/oracle/instantclient \ + --with-oci8=shared,instantclient,/opt/oracle/instantclient \ + --enable-werror \ + --with-config-file-path=/etc \ + --with-config-file-scan-dir=/etc/php.d \ + ${{ inputs.configurationParameters }} diff --git a/.github/actions/install-linux/action.yml b/.github/actions/install-linux/action.yml new file mode 100644 index 0000000000000..ad8b95f795cc1 --- /dev/null +++ b/.github/actions/install-linux/action.yml @@ -0,0 +1,14 @@ +name: Install +runs: + using: composite + steps: + - shell: bash + run: | + set -e + 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 + echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini + echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini diff --git a/.github/actions/mssql/action.yml b/.github/actions/mssql/action.yml new file mode 100644 index 0000000000000..0d03b6dc4bce0 --- /dev/null +++ b/.github/actions/mssql/action.yml @@ -0,0 +1,13 @@ +name: Create mssql container +runs: + using: composite + steps: + - shell: bash + run: | + docker run \ + -e "ACCEPT_EULA=Y" \ + -e "SA_PASSWORD=" \ + -p 1433:1433 \ + --name sql1 \ + -h sql1 \ + -d mcr.microsoft.com/mssql/server:2019-CU8-ubuntu-16.04 diff --git a/.github/actions/setup-i386/action.yml b/.github/actions/setup-i386/action.yml new file mode 100644 index 0000000000000..664c911a71aec --- /dev/null +++ b/.github/actions/setup-i386/action.yml @@ -0,0 +1,11 @@ +name: apt +runs: + using: composite + steps: + - shell: bash + run: | + set -e + sudo service mysql start + mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" + #sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';" + #sudo -u postgres psql -c "CREATE DATABASE test;" diff --git a/.github/actions/setup-x64/action.yml b/.github/actions/setup-x64/action.yml new file mode 100644 index 0000000000000..80b5a0bbef3e3 --- /dev/null +++ b/.github/actions/setup-x64/action.yml @@ -0,0 +1,31 @@ +name: apt +runs: + using: composite + steps: + - shell: bash + run: | + set -e + sudo service mysql start + sudo service postgresql start + sudo service slapd start + mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" + # Ensure local_infile tests can run. + mysql -uroot -proot -e "SET GLOBAL local_infile = true" + sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';" + sudo -u postgres psql -c "CREATE DATABASE test;" + docker exec sql1 /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U SA -P "" -Q "create login pdo_test with password='password', check_policy=off; create user pdo_test for login pdo_test; grant alter, control to pdo_test;" + sudo locale-gen de_DE + + ./.github/scripts/setup-slapd.sh + + set -e + sudo cp ext/snmp/tests/snmpd.conf /etc/snmp + sudo cp ext/snmp/tests/bigtest /etc/snmp + sudo service snmpd restart + + set -e + sudo groupadd -g 5000 vmail + sudo useradd -m -d /var/vmail -s /bin/false -u 5000 -g vmail vmail + sudo cp ext/imap/tests/setup/dovecot.conf /etc/dovecot/dovecot.conf + sudo cp ext/imap/tests/setup/dovecotpass /etc/dovecot/dovecotpass + sudo service dovecot restart diff --git a/.github/actions/test-linux/action.yml b/.github/actions/test-linux/action.yml new file mode 100644 index 0000000000000..8fb8d6df60265 --- /dev/null +++ b/.github/actions/test-linux/action.yml @@ -0,0 +1,27 @@ +name: apt +inputs: + runTestsParameters: + default: '' + required: false +runs: + using: composite + steps: + - shell: bash + run: | + export MYSQL_TEST_USER=root + export MYSQL_TEST_PASSWD=root + export PDO_MYSQL_TEST_DSN="mysql:host=localhost;dbname=test" + export PDO_MYSQL_TEST_USER=root + export PDO_MYSQL_TEST_PASS=root + export PDO_DBLIB_TEST_DSN="dblib:host=127.0.0.1;dbname=master;version=7.0" + export PDO_DBLIB_TEST_USER="pdo_test" + export PDO_DBLIB_TEST_PASS="password" + export REPORT_EXIT_STATUS=no + export SKIP_IO_CAPTURE_TESTS=1 + sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \ + -j$(/usr/bin/nproc) \ + -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP \ + --offline \ + --show-diff \ + --show-slow 1000 \ + --set-timeout 120 diff --git a/.github/actions/test-macos/action.yml b/.github/actions/test-macos/action.yml new file mode 100644 index 0000000000000..19eb5cbda202b --- /dev/null +++ b/.github/actions/test-macos/action.yml @@ -0,0 +1,20 @@ +name: apt +inputs: + runTestsParameters: + default: '' + required: false +runs: + using: composite + steps: + - shell: bash + run: | + export REPORT_EXIT_STATUS=no + export SKIP_IO_CAPTURE_TESTS=1 + export CI_NO_IPV6=1 + sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \ + -j$(sysctl -n hw.ncpu) \ + -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP \ + --offline \ + --show-diff \ + --show-slow 1000 \ + --set-timeout 120 diff --git a/.github/matrix.php b/.github/matrix.php new file mode 100644 index 0000000000000..47d96d15857b7 --- /dev/null +++ b/.github/matrix.php @@ -0,0 +1,229 @@ + 'Nightly', + //'on' => ['schedule' => [['cron' => '0 1 * * *']]], + 'on' => ['push'], + 'jobs' => [], + ]; + + foreach (['PHP-7.4', 'PHP-8.0', 'PHP-8.1', 'master'] as $branch) { + $branch_key = strtoupper(str_replace('.', '', $branch)); + + foreach (['linux_x64', 'linux_i386', 'macos'] as $plf) { + foreach ([true, false] as $debug) { + foreach ([true, false] as $zts) { + $job_name = $branch_key . '_' . strtoupper($plf) . '_' . ($debug ? 'DEBUG' : 'RELEASE') . '_' . ($zts ? 'ZTS' : 'NTS'); + $configuration_parameters = '--' . ($debug ? 'enable' : 'disable') . '-debug --' . ($zts ? 'enable' : 'disable') . '-zts'; + + $result['jobs'][] = $plf( + name: $job_name, + configuration_parameters: $configuration_parameters, + extended_tests: true, + branch: $branch, + ); + } + $result['jobs'][] = linux_x64( + name: $branch_key . '_DEBUG_ZTS_ASAN_UBSAN', + configuration_parameters: '--enable-debug --enable-zts --enable-address-sanitizer --enable-undefined-sanitizer', + extended_tests: true, + run_tests_parameters: '--asan', + branch: $branch, + ); + } + } + } + + return $result; + + echo "::set-output name=matrix::" . json_encode(['include' => $result], JSON_UNESCAPED_SLASHES); +} + +function job($name, $runs_on, $branch, $steps) { + $checkout = ['name' => 'git checkout', 'uses' => 'actions/checkout@v2']; + if ($branch !== null) $checkout['with']['ref'] = $branch; + return [ + 'name' => $name, + 'runs-on' => $runs_on, + 'steps' => [$checkout, ...$steps], + ]; +} + +function linux_x64( + $name, + $configuration_parameters = '', + $extended_tests = false, + $run_tests_parameters = '', + $branch = null, +) { + return job($name, 'ubuntu-20.04', $branch, [ + create_mssql_container(), + apt_x64(), + configure_x64($configuration_parameters), + make_linux(), + install_linux(), + setup_x64(), + ...tests_linux($extended_tests, run_tests_parameters: $run_tests_parameters), + ]); +} + +function linux_i386( + $name, + $configuration_parameters, + $extended_tests, + $branch = null, +) { + return job($name, 'ubuntu-20.04', $branch, [ + apt_i386(), + configure_i386($configuration_parameters), + make_linux(), + install_linux(), + setup_i386(), + ...tests_linux($extended_tests), + ]); +} + +function macos( + $name, + $configuration_parameters, + $extended_tests, + $branch = null, +) { + return job($name, 'macOS-10.15', $branch, [ + brew(), + configure_macos($configuration_parameters), + make_macos(), + install_macos(), + ...tests_macos($extended_tests), + ]); +} + +function create_mssql_container() { + return ['name' => 'Create mssql container', 'uses' => './.github/actions/mssql']; +} + +function apt_x64() { + return ['name' => 'apt', 'uses' => './.github/actions/apt-x64']; +} + +function apt_i386() { + return ['name' => 'apt', 'uses' => './.github/actions/apt-i386']; +} + +function brew() { + return ['name' => 'brew', 'uses' => './.github/actions/brew']; +} + +function configure_x64($configuration_parameters) { + return ['name' => './configure', 'uses' => './.github/actions/configure-x64', 'with' => ['configurationParameters' => $configuration_parameters]]; +} + +function configure_i386($configuration_parameters) { + return ['name' => './configure', 'uses' => './.github/actions/configure-i386', 'with' => ['configurationParameters' => $configuration_parameters]]; +} + +function configure_macos($configuration_parameters) { + return ['name' => './configure', 'uses' => './.github/actions/configure-macos', 'with' => ['configurationParameters' => $configuration_parameters]]; +} + +function make_linux() { + return ['name' => 'make', 'run' => 'make -j$(/usr/bin/nproc) >/dev/null']; +} + +function make_macos() { + return ['name' => 'make', 'run' => <</dev/null + BASH]; +} + +function install_linux() { + return ['name' => 'make install', 'uses' => './.github/actions/install-linux']; +} + +function install_macos() { + return ['name' => 'make install', 'run' => 'sudo make install']; +} + +function setup_x64() { + return ['name' => 'Setup', 'uses' => './.github/actions/setup-x64']; +} + +function setup_i386() { + return ['name' => 'Setup', 'uses' => './.github/actions/setup-i386']; +} + +function tests_linux($extended_tests, $run_tests_parameters = '') { + $opcache_param = '-d zend_extension=opcache.so'; + + $result = [ + test_linux('Test', $run_tests_parameters), + test_linux('Test Tracing JIT', "$run_tests_parameters $opcache_param -d opcache.jit_buffer_size=16M"), + ]; + + if ($extended_tests) { + $result[] = test_linux('Test OpCache', "$run_tests_parameters $opcache_param"); + $result[] = test_linux('Test Function JIT', "$run_tests_parameters $opcache_param -d opcache.jit_buffer_size=16M -d opcache.jit=1205"); + } + + return $result; +} + +function test_linux($step_name, $run_tests_parameters) { + return ['name' => $step_name, 'uses' => './.github/actions/test-linux', 'with' => ['runTestsParameters' => $run_tests_parameters]]; +} + +function tests_macos($extended_tests) { + $opcache_param = '-d zend_extension=opcache.so -d opcache.protect_memory=1'; + + $result = [ + test_macos('Test', ''), + test_macos('Test Tracing JIT', "$opcache_param -d opcache.jit_buffer_size=16M"), + ]; + + if ($extended_tests) { + $result[] = test_macos('Test OpCache', $opcache_param); + $result[] = test_macos('Test Function JIT', "$opcache_param -d opcache.jit_buffer_size=16M -d opcache.jit=1205"); + } + + return $result; +} + +function test_macos($step_name, $run_tests_parameters) { + return ['name' => $step_name, 'uses' => './.github/actions/test-macos', 'with' => ['runTestsParameters' => $run_tests_parameters]]; +} + +$result = match ($argv[1]) { + 'push' => generate_push(), + 'schedule' => generate_nightly(), + default => throw new \InvalidArgumentException('Event name should be "push" or "schedule"'), +}; +echo '::set-output name=matrix::' . json_encode(['include' => $result], JSON_UNESCAPED_SLASHES) . "\n"; diff --git a/.github/scripts/setup-slapd.sh b/.github/scripts/setup-slapd.sh new file mode 100755 index 0000000000000..7ea3cb33b3d0e --- /dev/null +++ b/.github/scripts/setup-slapd.sh @@ -0,0 +1,185 @@ +#!/bin/sh +set -ev + +# Create TLS certificate +sudo mkdir -p /etc/ldap/ssl + +alt_names() { + ( + ( + (hostname && hostname -a && hostname -A && hostname -f) | + xargs -n 1 | + sort -u | + sed -e 's/\(\S\+\)/DNS:\1/g' + ) && ( + (hostname -i && hostname -I && echo "127.0.0.1 ::1") | + xargs -n 1 | + sort -u | + sed -e 's/\(\S\+\)/IP:\1/g' + ) + ) | paste -d, -s +} + +sudo openssl req -newkey rsa:4096 -x509 -nodes -days 3650 \ + -out /etc/ldap/ssl/server.crt -keyout /etc/ldap/ssl/server.key \ + -subj "/C=US/ST=Arizona/L=Localhost/O=localhost/CN=localhost" \ + -addext "subjectAltName = `alt_names`" + +sudo chown -R openldap:openldap /etc/ldap/ssl + +# Display the TLS certificate (should be world readable) +openssl x509 -noout -text -in /etc/ldap/ssl/server.crt + +# Point to the certificate generated +if ! grep -q 'TLS_CACERT \/etc\/ldap\/ssl\/server.crt' /etc/ldap/ldap.conf; then + sudo sed -e 's|^\s*TLS_CACERT|# TLS_CACERT|' -i /etc/ldap/ldap.conf + echo 'TLS_CACERT /etc/ldap/ssl/server.crt' | sudo tee -a /etc/ldap/ldap.conf +fi + +# Configure LDAP protocols to serve. +sudo sed -e 's|^\s*SLAPD_SERVICES\s*=.*$|SLAPD_SERVICES="ldap:/// ldaps:/// ldapi:///"|' -i /etc/default/slapd + +# Configure LDAP database. +DBDN=`sudo ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// -b cn=config '(&(olcRootDN=*)(olcSuffix=*))' dn | grep -i '^dn:' | sed -e 's/^dn:\s*//'`; + +sudo ldapadd -Q -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/ppolicy.ldif + +sudo service slapd restart + +sudo ldapmodify -Q -Y EXTERNAL -H ldapi:/// << EOF +dn: $DBDN +changetype: modify +replace: olcSuffix +olcSuffix: dc=my-domain,dc=com +- +replace: olcRootDN +olcRootDN: cn=Manager,dc=my-domain,dc=com +- +replace: olcRootPW +olcRootPW: secret + +dn: cn=config +changetype: modify +add: olcTLSCACertificateFile +olcTLSCACertificateFile: /etc/ldap/ssl/server.crt +- +add: olcTLSCertificateFile +olcTLSCertificateFile: /etc/ldap/ssl/server.crt +- +add: olcTLSCertificateKeyFile +olcTLSCertificateKeyFile: /etc/ldap/ssl/server.key +- +add: olcTLSVerifyClient +olcTLSVerifyClient: never +- +add: olcAuthzRegexp +olcAuthzRegexp: uid=usera,cn=digest-md5,cn=auth cn=usera,dc=my-domain,dc=com +- +replace: olcLogLevel +olcLogLevel: -1 + +dn: cn=module{0},cn=config +changetype: modify +add: olcModuleLoad +olcModuleLoad: sssvlv +- +add: olcModuleLoad +olcModuleLoad: ppolicy +- +add: olcModuleLoad +olcModuleLoad: dds +EOF + +sudo service slapd restart + +sudo ldapadd -Q -Y EXTERNAL -H ldapi:/// << EOF +dn: olcOverlay=sssvlv,$DBDN +objectClass: olcOverlayConfig +objectClass: olcSssVlvConfig +olcOverlay: sssvlv +olcSssVlvMax: 10 +olcSssVlvMaxKeys: 5 + +dn: olcOverlay=ppolicy,$DBDN +objectClass: olcOverlayConfig +objectClass: olcPPolicyConfig +olcOverlay: ppolicy +### This would clutter our DIT and make tests to fail, while ppolicy does not +### seem to work as we expect (it does not seem to provide expected controls) +## olcPPolicyDefault: cn=default,ou=pwpolicies,dc=my-domain,dc=com +## olcPPolicyHashCleartext: FALSE +## olcPPolicyUseLockout: TRUE + +dn: olcOverlay=dds,$DBDN +objectClass: olcOverlayConfig +objectClass: olcDdsConfig +olcOverlay: dds +EOF + +sudo service slapd restart + +sudo ldapmodify -Q -Y EXTERNAL -H ldapi:/// << EOF +dn: $DBDN +changetype: modify +add: olcDbIndex +olcDbIndex: entryExpireTimestamp eq +EOF + +sudo service slapd restart + +ldapadd -H ldapi:/// -D cn=Manager,dc=my-domain,dc=com -w secret < Date: Fri, 11 Feb 2022 15:14:30 +0100 Subject: [PATCH 2/7] wip --- .github/actions/linux-x64/action.yml | 30 ++++ .github/actions/macos/action.yml | 31 ++++ .github/actions/tests-linux/action.yml | 27 +++ .github/actions/tests-macos/action.yml | 27 +++ .github/matrix.php | 229 ------------------------- .github/workflows/push.yml | 33 ++-- 6 files changed, 135 insertions(+), 242 deletions(-) create mode 100644 .github/actions/linux-x64/action.yml create mode 100644 .github/actions/macos/action.yml create mode 100644 .github/actions/tests-linux/action.yml create mode 100644 .github/actions/tests-macos/action.yml delete mode 100644 .github/matrix.php diff --git a/.github/actions/linux-x64/action.yml b/.github/actions/linux-x64/action.yml new file mode 100644 index 0000000000000..d1192b43b416e --- /dev/null +++ b/.github/actions/linux-x64/action.yml @@ -0,0 +1,30 @@ +name: Linux x64 +inputs: + configurationParameters: + required: true + extendedTests: + required: true +runs: + using: composite + steps: + - name: git checkout + uses: actions/checkout@v2 + - name: Create mssql container + uses: ./.github/actions/mssql + - name: apt + uses: ./.github/actions/apt-x64 + - name: ./configure + uses: ./.github/actions/configure-x64 + with: + configurationParameters: ${{ inputs.configurationParameters }} + - name: make + shell: bash + run: make -j$(/usr/bin/nproc) >/dev/null + - name: make install + uses: ./.github/actions/install-linux + - name: Setup + uses: ./.github/actions/setup-x64 + - name: Test + uses: ./.github/actions/tests-linux + with: + extended: ${{ inputs.extendedTests }} diff --git a/.github/actions/macos/action.yml b/.github/actions/macos/action.yml new file mode 100644 index 0000000000000..06c2bc1af693a --- /dev/null +++ b/.github/actions/macos/action.yml @@ -0,0 +1,31 @@ +name: macos +inputs: + configurationParameters: + required: true + extendedTests: + required: true +runs: + using: composite + steps: + - name: git checkout + uses: actions/checkout@v2 + - name: brew + uses: ./.github/actions/brew + - name: ./configure + uses: ./.github/actions/configure-macos + with: + configurationParameters: ${{ inputs.configurationParameters }} + - name: make + shell: bash + run: | + export PATH="/usr/local/opt/bison/bin:$PATH" + make -j$(sysctl -n hw.logicalcpu) >/dev/null + - name: make + shell: bash + run: sudo make install + - name: Setup + uses: ./.github/actions/setup-x64 + - name: Test + uses: ./.github/actions/tests-linux + with: + extended: ${{ inputs.extendedTests }} diff --git a/.github/actions/tests-linux/action.yml b/.github/actions/tests-linux/action.yml new file mode 100644 index 0000000000000..e8fb34fee58b9 --- /dev/null +++ b/.github/actions/tests-linux/action.yml @@ -0,0 +1,27 @@ +name: Tests Linux +inputs: + extended: + required: true + runTestsParameters: + default: '' + required: false +runs: + using: composite + steps: + - uses: ./.github/actions/linux-test + with: + runTestsParameters: ${{ inputs.runTestsParameters }} + - name: Tracing JIT + uses: ./.github/actions/linux-test + with: + runTestsParameters: '${{ inputs.runTestsParameters }} -d zend_extension=opcache.so -d opcache.jit_buffer_size=16M' + - name: OpCache + if: ${{ inputs.extended }} + uses: ./.github/actions/linux-test + with: + runTestsParameters: '${{ inputs.runTestsParameters }} -d zend_extension=opcache.so' + - name: Function JIT + if: ${{ inputs.extended }} + uses: ./.github/actions/linux-test + with: + runTestsParameters: '${{ inputs.runTestsParameters }} -d zend_extension=opcache.so -d opcache.jit_buffer_size=16M -d opcache.jit=1205' diff --git a/.github/actions/tests-macos/action.yml b/.github/actions/tests-macos/action.yml new file mode 100644 index 0000000000000..1d8ee06776143 --- /dev/null +++ b/.github/actions/tests-macos/action.yml @@ -0,0 +1,27 @@ +name: Tests macos +inputs: + extended: + required: true + runTestsParameters: + default: '' + required: false +runs: + using: composite + steps: + - uses: ./.github/actions/macos-test + with: + runTestsParameters: ${{ inputs.runTestsParameters }} + - name: Tracing JIT + uses: ./.github/actions/macos-test + with: + runTestsParameters: '${{ inputs.runTestsParameters }} -d zend_extension=opcache.so -d opcache.protect_memory=1 -d opcache.jit_buffer_size=16M' + - name: OpCache + if: ${{ inputs.extended }} + uses: ./.github/actions/macos-test + with: + runTestsParameters: '${{ inputs.runTestsParameters }} -d zend_extension=opcache.so -d opcache.protect_memory=1' + - name: Function JIT + if: ${{ inputs.extended }} + uses: ./.github/actions/macos-test + with: + runTestsParameters: '${{ inputs.runTestsParameters }} -d zend_extension=opcache.so -d opcache.protect_memory=1 -d opcache.jit_buffer_size=16M -d opcache.jit=1205' diff --git a/.github/matrix.php b/.github/matrix.php deleted file mode 100644 index 47d96d15857b7..0000000000000 --- a/.github/matrix.php +++ /dev/null @@ -1,229 +0,0 @@ - 'Nightly', - //'on' => ['schedule' => [['cron' => '0 1 * * *']]], - 'on' => ['push'], - 'jobs' => [], - ]; - - foreach (['PHP-7.4', 'PHP-8.0', 'PHP-8.1', 'master'] as $branch) { - $branch_key = strtoupper(str_replace('.', '', $branch)); - - foreach (['linux_x64', 'linux_i386', 'macos'] as $plf) { - foreach ([true, false] as $debug) { - foreach ([true, false] as $zts) { - $job_name = $branch_key . '_' . strtoupper($plf) . '_' . ($debug ? 'DEBUG' : 'RELEASE') . '_' . ($zts ? 'ZTS' : 'NTS'); - $configuration_parameters = '--' . ($debug ? 'enable' : 'disable') . '-debug --' . ($zts ? 'enable' : 'disable') . '-zts'; - - $result['jobs'][] = $plf( - name: $job_name, - configuration_parameters: $configuration_parameters, - extended_tests: true, - branch: $branch, - ); - } - $result['jobs'][] = linux_x64( - name: $branch_key . '_DEBUG_ZTS_ASAN_UBSAN', - configuration_parameters: '--enable-debug --enable-zts --enable-address-sanitizer --enable-undefined-sanitizer', - extended_tests: true, - run_tests_parameters: '--asan', - branch: $branch, - ); - } - } - } - - return $result; - - echo "::set-output name=matrix::" . json_encode(['include' => $result], JSON_UNESCAPED_SLASHES); -} - -function job($name, $runs_on, $branch, $steps) { - $checkout = ['name' => 'git checkout', 'uses' => 'actions/checkout@v2']; - if ($branch !== null) $checkout['with']['ref'] = $branch; - return [ - 'name' => $name, - 'runs-on' => $runs_on, - 'steps' => [$checkout, ...$steps], - ]; -} - -function linux_x64( - $name, - $configuration_parameters = '', - $extended_tests = false, - $run_tests_parameters = '', - $branch = null, -) { - return job($name, 'ubuntu-20.04', $branch, [ - create_mssql_container(), - apt_x64(), - configure_x64($configuration_parameters), - make_linux(), - install_linux(), - setup_x64(), - ...tests_linux($extended_tests, run_tests_parameters: $run_tests_parameters), - ]); -} - -function linux_i386( - $name, - $configuration_parameters, - $extended_tests, - $branch = null, -) { - return job($name, 'ubuntu-20.04', $branch, [ - apt_i386(), - configure_i386($configuration_parameters), - make_linux(), - install_linux(), - setup_i386(), - ...tests_linux($extended_tests), - ]); -} - -function macos( - $name, - $configuration_parameters, - $extended_tests, - $branch = null, -) { - return job($name, 'macOS-10.15', $branch, [ - brew(), - configure_macos($configuration_parameters), - make_macos(), - install_macos(), - ...tests_macos($extended_tests), - ]); -} - -function create_mssql_container() { - return ['name' => 'Create mssql container', 'uses' => './.github/actions/mssql']; -} - -function apt_x64() { - return ['name' => 'apt', 'uses' => './.github/actions/apt-x64']; -} - -function apt_i386() { - return ['name' => 'apt', 'uses' => './.github/actions/apt-i386']; -} - -function brew() { - return ['name' => 'brew', 'uses' => './.github/actions/brew']; -} - -function configure_x64($configuration_parameters) { - return ['name' => './configure', 'uses' => './.github/actions/configure-x64', 'with' => ['configurationParameters' => $configuration_parameters]]; -} - -function configure_i386($configuration_parameters) { - return ['name' => './configure', 'uses' => './.github/actions/configure-i386', 'with' => ['configurationParameters' => $configuration_parameters]]; -} - -function configure_macos($configuration_parameters) { - return ['name' => './configure', 'uses' => './.github/actions/configure-macos', 'with' => ['configurationParameters' => $configuration_parameters]]; -} - -function make_linux() { - return ['name' => 'make', 'run' => 'make -j$(/usr/bin/nproc) >/dev/null']; -} - -function make_macos() { - return ['name' => 'make', 'run' => <</dev/null - BASH]; -} - -function install_linux() { - return ['name' => 'make install', 'uses' => './.github/actions/install-linux']; -} - -function install_macos() { - return ['name' => 'make install', 'run' => 'sudo make install']; -} - -function setup_x64() { - return ['name' => 'Setup', 'uses' => './.github/actions/setup-x64']; -} - -function setup_i386() { - return ['name' => 'Setup', 'uses' => './.github/actions/setup-i386']; -} - -function tests_linux($extended_tests, $run_tests_parameters = '') { - $opcache_param = '-d zend_extension=opcache.so'; - - $result = [ - test_linux('Test', $run_tests_parameters), - test_linux('Test Tracing JIT', "$run_tests_parameters $opcache_param -d opcache.jit_buffer_size=16M"), - ]; - - if ($extended_tests) { - $result[] = test_linux('Test OpCache', "$run_tests_parameters $opcache_param"); - $result[] = test_linux('Test Function JIT', "$run_tests_parameters $opcache_param -d opcache.jit_buffer_size=16M -d opcache.jit=1205"); - } - - return $result; -} - -function test_linux($step_name, $run_tests_parameters) { - return ['name' => $step_name, 'uses' => './.github/actions/test-linux', 'with' => ['runTestsParameters' => $run_tests_parameters]]; -} - -function tests_macos($extended_tests) { - $opcache_param = '-d zend_extension=opcache.so -d opcache.protect_memory=1'; - - $result = [ - test_macos('Test', ''), - test_macos('Test Tracing JIT', "$opcache_param -d opcache.jit_buffer_size=16M"), - ]; - - if ($extended_tests) { - $result[] = test_macos('Test OpCache', $opcache_param); - $result[] = test_macos('Test Function JIT', "$opcache_param -d opcache.jit_buffer_size=16M -d opcache.jit=1205"); - } - - return $result; -} - -function test_macos($step_name, $run_tests_parameters) { - return ['name' => $step_name, 'uses' => './.github/actions/test-macos', 'with' => ['runTestsParameters' => $run_tests_parameters]]; -} - -$result = match ($argv[1]) { - 'push' => generate_push(), - 'schedule' => generate_nightly(), - default => throw new \InvalidArgumentException('Event name should be "push" or "schedule"'), -}; -echo '::set-output name=matrix::' . json_encode(['include' => $result], JSON_UNESCAPED_SLASHES) . "\n"; diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 2d349eccfe62d..34865b513d3d9 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -10,21 +10,28 @@ on: - CONTRIBUTING.md - CODING_STANDARDS.md jobs: - generate-matrix: - name: Generate Build Matrix - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - uses: actions/checkout@v2 - - name: Generate Build Matrix - id: set-matrix - run: php .github/matrix.php "${{ github.event_name }}" test: - needs: generate-matrix strategy: - matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} + matrix: + include: + - name: LINUX_X64_DEBUG_NTS + action: linux-x64 + configurationParameters: --enable-debug --disable-zts + - name: LINUX_X64_RELEASE_ZTS + action: linux-x64 + configurationParameters: --disable-debug --enable-zts + # apt broken, not sure why + # - name: LINUX_I386_DEBUG_ZTS + # action: linux-i386 + # configurationParameters: --enable-debug --disable-zts + - name: MACOS_DEBUG_NTS + action: macos + configurationParameters: --enable-debug --disable-zts fail-fast: false name: ${{ matrix.name }} runs-on: ${{ matrix['runs-on'] }} - steps: ${{ matrix.steps }} + steps: + - uses: ${{ matrix.action }} + with: + configurationParameters: ${{ matrix.configurationParameters }} + extendedTests: false From 9ac198ba66856d98c774d181cdeb64340fdb878d Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Fri, 11 Feb 2022 16:18:14 +0100 Subject: [PATCH 3/7] wip --- .github/actions/apt-i386/action.yml | 45 ---- .github/actions/apt-x64/action.yml | 65 ------ .github/actions/brew/action.yml | 31 --- .github/actions/configure-i386/action.yml | 68 ------ .github/actions/configure-macos/action.yml | 70 ------ .github/actions/configure-x64/action.yml | 83 ------- .github/actions/configure/action.yml | 207 ++++++++++++++++++ .github/actions/deps/action.yml | 135 ++++++++++++ .github/actions/install-linux/action.yml | 14 -- .github/actions/install/action.yml | 18 ++ .github/actions/linux-x64/action.yml | 30 --- .github/actions/macos/action.yml | 31 --- .github/actions/setup-i386/action.yml | 11 - .github/actions/setup-x64/action.yml | 31 --- .github/actions/setup/action.yml | 34 +++ .github/actions/test-linux/action.yml | 27 --- .github/actions/test-macos/action.yml | 20 -- .github/actions/test/action.yml | 32 +++ .github/actions/tests-linux/action.yml | 27 --- .../actions/{tests-macos => tests}/action.yml | 16 +- .github/workflows/push.yml | 41 +++- 21 files changed, 469 insertions(+), 567 deletions(-) delete mode 100644 .github/actions/apt-i386/action.yml delete mode 100644 .github/actions/apt-x64/action.yml delete mode 100644 .github/actions/brew/action.yml delete mode 100644 .github/actions/configure-i386/action.yml delete mode 100644 .github/actions/configure-macos/action.yml delete mode 100644 .github/actions/configure-x64/action.yml create mode 100644 .github/actions/configure/action.yml create mode 100644 .github/actions/deps/action.yml delete mode 100644 .github/actions/install-linux/action.yml create mode 100644 .github/actions/install/action.yml delete mode 100644 .github/actions/linux-x64/action.yml delete mode 100644 .github/actions/macos/action.yml delete mode 100644 .github/actions/setup-i386/action.yml delete mode 100644 .github/actions/setup-x64/action.yml create mode 100644 .github/actions/setup/action.yml delete mode 100644 .github/actions/test-linux/action.yml delete mode 100644 .github/actions/test-macos/action.yml create mode 100644 .github/actions/test/action.yml delete mode 100644 .github/actions/tests-linux/action.yml rename .github/actions/{tests-macos => tests}/action.yml (53%) diff --git a/.github/actions/apt-i386/action.yml b/.github/actions/apt-i386/action.yml deleted file mode 100644 index 44768cf5c6e52..0000000000000 --- a/.github/actions/apt-i386/action.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: apt -runs: - using: composite - steps: - - shell: bash - run: | - sudo dpkg --add-architecture i386 - sudo apt-get update -y | true - sudo apt-get install -y gcc-multilib - sudo apt-get install -y g++-multilib - sudo apt-get purge -y libxml2 - # TODO: Reenable postgresql + postgresql-contrib packages once they work again. - sudo apt-get purge -y libpq5 - sudo apt-get install -y libc6:i386 - sudo apt-get install -y bison \ - re2c \ - locales \ - language-pack-de \ - libssl-dev:i386 \ - zlib1g-dev:i386 \ - libxml2-dev:i386 \ - libgmp-dev:i386 \ - libicu-dev:i386 \ - libtidy-dev:i386 \ - libaspell-dev:i386 \ - libpspell-dev:i386 \ - libsasl2-dev:i386 \ - libxpm-dev:i386 \ - libjpeg-dev:i386 \ - libpng-dev:i386 \ - libzip-dev:i386 \ - libbz2-dev:i386 \ - libsqlite3-dev:i386 \ - libwebp-dev:i386 \ - libonig-dev:i386 \ - libkrb5-dev:i386 \ - libgssapi-krb5-2:i386 \ - libcurl4-openssl-dev:i386 \ - libxml2-dev:i386 \ - libxslt1-dev:i386 \ - libpq-dev:i386 \ - libreadline-dev:i386 \ - libffi-dev:i386 \ - libfreetype6-dev:i386 \ - libsodium-dev:i386 diff --git a/.github/actions/apt-x64/action.yml b/.github/actions/apt-x64/action.yml deleted file mode 100644 index aa7965cb30384..0000000000000 --- a/.github/actions/apt-x64/action.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: apt -runs: - using: composite - steps: - - shell: bash - run: | - sudo apt install bison \ - re2c \ - locales \ - ldap-utils \ - openssl \ - slapd \ - language-pack-de \ - libgmp-dev \ - libicu-dev \ - libtidy-dev \ - libenchant-dev \ - libaspell-dev \ - libpspell-dev \ - libsasl2-dev \ - libxpm-dev \ - libzip-dev \ - libsqlite3-dev \ - libwebp-dev \ - libonig-dev \ - libkrb5-dev \ - libgssapi-krb5-2 \ - libcurl4-openssl-dev \ - libxml2-dev \ - libxslt1-dev \ - libpq-dev \ - libreadline-dev \ - libldap2-dev \ - libsodium-dev \ - libargon2-0-dev \ - libmm-dev \ - libsnmp-dev \ - postgresql \ - postgresql-contrib \ - snmpd \ - snmp-mibs-downloader \ - freetds-dev \ - unixodbc-dev \ - llvm \ - libc-client-dev \ - dovecot-core \ - dovecot-pop3d \ - dovecot-imapd \ - sendmail \ - firebird-dev \ - liblmdb-dev \ - libtokyocabinet-dev \ - libdb-dev \ - libqdbm-dev \ - libjpeg-dev \ - libpng-dev \ - libfreetype6-dev - mkdir /opt/oracle - wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip - unzip instantclient-basiclite-linuxx64.zip - wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linuxx64.zip - unzip instantclient-sdk-linuxx64.zip - mv instantclient_*_* /opt/oracle/instantclient - # Interferes with libldap2 headers. - rm /opt/oracle/instantclient/sdk/include/ldap.h diff --git a/.github/actions/brew/action.yml b/.github/actions/brew/action.yml deleted file mode 100644 index 3b4fcf18b0efe..0000000000000 --- a/.github/actions/brew/action.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: brew -runs: - using: composite - steps: - - shell: bash - run: | - brew install pkg-config \ - autoconf \ - bison \ - re2c - brew install openssl@1.1 \ - krb5 \ - bzip2 \ - enchant \ - libffi \ - libpng \ - webp \ - freetype \ - intltool \ - icu4c \ - libiconv \ - zlib \ - t1lib \ - gd \ - libzip \ - gmp \ - tidyp \ - libxml2 \ - libxslt \ - postgresql - brew link icu4c gettext --force diff --git a/.github/actions/configure-i386/action.yml b/.github/actions/configure-i386/action.yml deleted file mode 100644 index 0e1686d6b848b..0000000000000 --- a/.github/actions/configure-i386/action.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: ./configure -inputs: - configurationParameters: - default: '' - required: false -runs: - using: composite - steps: - - shell: bash - run: | - ./buildconf --force - export CFLAGS="-m32 -msse2" - export CXXFLAGS="-m32 -msse2" - export LDFLAGS=-L/usr/lib/i386-linux-gnu - export PKG_CONFIG=/usr/bin/i686-linux-gnu-pkg-config - ./configure \ - --enable-option-checking=fatal \ - --build=i686-pc-linux-gnu \ - --prefix=/usr \ - --enable-phpdbg \ - --enable-fpm \ - --enable-intl \ - --with-pdo-mysql=mysqlnd \ - --with-mysqli=mysqlnd \ - --with-pgsql \ - --with-pdo-pgsql \ - --with-pdo-sqlite \ - --without-pear \ - --enable-gd \ - --with-jpeg \ - --with-webp \ - --with-freetype \ - --with-xpm \ - --enable-exif \ - --with-zip \ - --with-zlib \ - --with-zlib-dir=/usr \ - --enable-soap \ - --enable-xmlreader \ - --with-xsl \ - --with-tidy \ - --enable-sysvsem \ - --enable-sysvshm \ - --enable-shmop \ - --enable-pcntl \ - --with-readline \ - --enable-mbstring \ - --with-curl \ - --with-gettext \ - --enable-sockets \ - --with-bz2 \ - --with-openssl \ - --with-gmp \ - --enable-bcmath \ - --enable-calendar \ - --enable-ftp \ - --with-pspell=/usr \ - --with-kerberos \ - --enable-sysvmsg \ - --with-ffi \ - --enable-zend-test \ - --with-mhash \ - --with-sodium \ - --enable-dba \ - --enable-werror \ - --with-config-file-path=/etc \ - --with-config-file-scan-dir=/etc/php.d \ - ${{ inputs.configurationParameters }} diff --git a/.github/actions/configure-macos/action.yml b/.github/actions/configure-macos/action.yml deleted file mode 100644 index f99fa4f5c3ac5..0000000000000 --- a/.github/actions/configure-macos/action.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: ./configure -inputs: - configurationParameters: - default: '' - required: false -runs: - using: composite - steps: - - shell: bash - run: | - export PATH="/usr/local/opt/bison/bin:$PATH" - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/openssl@1.1/lib/pkgconfig" - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/krb5/lib/pkgconfig" - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libffi/lib/pkgconfig" - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libxml2/lib/pkgconfig" - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libxslt/lib/pkgconfig" - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/zlib/lib/pkgconfig" - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/icu4c/lib/pkgconfig" - ./buildconf --force - ./configure \ - --enable-option-checking=fatal \ - --prefix=/usr/local \ - --enable-fpm \ - --with-pdo-mysql=mysqlnd \ - --with-mysqli=mysqlnd \ - --with-pgsql=/usr/local/opt/libpq \ - --with-pdo-pgsql=/usr/local/opt/libpq \ - --with-pdo-sqlite \ - --without-pear \ - --enable-gd \ - --with-jpeg \ - --with-webp \ - --with-freetype \ - --enable-exif \ - --with-zip \ - --with-zlib \ - --enable-soap \ - --enable-xmlreader \ - --with-xsl \ - --with-tidy=/usr/local/opt/tidyp \ - --with-libxml \ - --enable-sysvsem \ - --enable-sysvshm \ - --enable-shmop \ - --enable-pcntl \ - --with-readline=/usr/local/opt/readline \ - --enable-mbstring \ - --with-curl \ - --with-gettext=/usr/local/opt/gettext \ - --enable-sockets \ - --with-bz2=/usr/local/opt/bzip2 \ - --with-openssl \ - --with-gmp=/usr/local/opt/gmp \ - --with-iconv=/usr/local/opt/libiconv \ - --enable-bcmath \ - --enable-calendar \ - --enable-ftp \ - --with-pspell=/usr/local/opt/aspell \ - --with-kerberos \ - --enable-sysvmsg \ - --with-ffi \ - --enable-zend-test \ - --enable-intl \ - --with-mhash \ - --with-sodium \ - --enable-dba \ - --enable-werror \ - --with-config-file-path=/etc \ - --with-config-file-scan-dir=/etc/php.d \ - ${{ inputs.configurationParameters }} diff --git a/.github/actions/configure-x64/action.yml b/.github/actions/configure-x64/action.yml deleted file mode 100644 index 2283ccee42158..0000000000000 --- a/.github/actions/configure-x64/action.yml +++ /dev/null @@ -1,83 +0,0 @@ -name: ./configure -inputs: - configurationParameters: - default: '' - required: false -runs: - using: composite - steps: - - shell: bash - run: | - ./buildconf --force - ./configure \ - --enable-option-checking=fatal \ - --prefix=/usr \ - --enable-phpdbg \ - --enable-fpm \ - --with-pdo-mysql=mysqlnd \ - --with-mysqli=mysqlnd \ - --with-pgsql \ - --with-pdo-pgsql \ - --with-pdo-sqlite \ - --enable-intl \ - --without-pear \ - --enable-gd \ - --with-jpeg \ - --with-webp \ - --with-freetype \ - --with-xpm \ - --enable-exif \ - --with-zip \ - --with-zlib \ - --with-zlib-dir=/usr \ - --enable-soap \ - --enable-xmlreader \ - --with-xsl \ - --with-tidy \ - --enable-sysvsem \ - --enable-sysvshm \ - --enable-shmop \ - --enable-pcntl \ - --with-readline \ - --enable-mbstring \ - --with-curl \ - --with-gettext \ - --enable-sockets \ - --with-bz2 \ - --with-openssl \ - --with-gmp \ - --enable-bcmath \ - --enable-calendar \ - --enable-ftp \ - --with-pspell=/usr \ - --with-enchant=/usr \ - --with-kerberos \ - --enable-sysvmsg \ - --with-ffi \ - --enable-zend-test \ - --with-ldap \ - --with-ldap-sasl \ - --with-password-argon2 \ - --with-mhash \ - --with-sodium \ - --enable-dba \ - --with-cdb \ - --enable-flatfile \ - --enable-inifile \ - --with-tcadb \ - --with-lmdb \ - --with-qdbm \ - --with-snmp \ - --with-unixODBC \ - --with-imap \ - --with-kerberos \ - --with-imap-ssl \ - --with-pdo-odbc=unixODBC,/usr \ - --with-pdo-firebird \ - --with-pdo-dblib \ - --with-pdo-oci=shared,instantclient,/opt/oracle/instantclient \ - --with-oci8=shared,instantclient,/opt/oracle/instantclient \ - --enable-werror \ - --with-config-file-path=/etc \ - --with-config-file-scan-dir=/etc/php.d \ - ${{ inputs.configurationParameters }} diff --git a/.github/actions/configure/action.yml b/.github/actions/configure/action.yml new file mode 100644 index 0000000000000..5c4c29437a528 --- /dev/null +++ b/.github/actions/configure/action.yml @@ -0,0 +1,207 @@ +name: ./configure +inputs: + configurationParameters: + default: '' + required: false +runs: + using: composite + steps: + - shell: bash + run: | + if [ "$ARCH" == "linux-x64" ]; then + ./buildconf --force + ./configure \ + --enable-option-checking=fatal \ + --prefix=/usr \ + --enable-phpdbg \ + --enable-fpm \ + --with-pdo-mysql=mysqlnd \ + --with-mysqli=mysqlnd \ + --with-pgsql \ + --with-pdo-pgsql \ + --with-pdo-sqlite \ + --enable-intl \ + --without-pear \ + --enable-gd \ + --with-jpeg \ + --with-webp \ + --with-freetype \ + --with-xpm \ + --enable-exif \ + --with-zip \ + --with-zlib \ + --with-zlib-dir=/usr \ + --enable-soap \ + --enable-xmlreader \ + --with-xsl \ + --with-tidy \ + --enable-sysvsem \ + --enable-sysvshm \ + --enable-shmop \ + --enable-pcntl \ + --with-readline \ + --enable-mbstring \ + --with-curl \ + --with-gettext \ + --enable-sockets \ + --with-bz2 \ + --with-openssl \ + --with-gmp \ + --enable-bcmath \ + --enable-calendar \ + --enable-ftp \ + --with-pspell=/usr \ + --with-enchant=/usr \ + --with-kerberos \ + --enable-sysvmsg \ + --with-ffi \ + --enable-zend-test \ + --with-ldap \ + --with-ldap-sasl \ + --with-password-argon2 \ + --with-mhash \ + --with-sodium \ + --enable-dba \ + --with-cdb \ + --enable-flatfile \ + --enable-inifile \ + --with-tcadb \ + --with-lmdb \ + --with-qdbm \ + --with-snmp \ + --with-unixODBC \ + --with-imap \ + --with-kerberos \ + --with-imap-ssl \ + --with-pdo-odbc=unixODBC,/usr \ + --with-pdo-firebird \ + --with-pdo-dblib \ + --with-pdo-oci=shared,instantclient,/opt/oracle/instantclient \ + --with-oci8=shared,instantclient,/opt/oracle/instantclient \ + --enable-werror \ + --with-config-file-path=/etc \ + --with-config-file-scan-dir=/etc/php.d \ + ${{ inputs.configurationParameters }} + fi + if [ "$ARCH" == "linux-i386" ]; then + ./buildconf --force + export CFLAGS="-m32 -msse2" + export CXXFLAGS="-m32 -msse2" + export LDFLAGS=-L/usr/lib/i386-linux-gnu + export PKG_CONFIG=/usr/bin/i686-linux-gnu-pkg-config + ./configure \ + --enable-option-checking=fatal \ + --build=i686-pc-linux-gnu \ + --prefix=/usr \ + --enable-phpdbg \ + --enable-fpm \ + --enable-intl \ + --with-pdo-mysql=mysqlnd \ + --with-mysqli=mysqlnd \ + --with-pgsql \ + --with-pdo-pgsql \ + --with-pdo-sqlite \ + --without-pear \ + --enable-gd \ + --with-jpeg \ + --with-webp \ + --with-freetype \ + --with-xpm \ + --enable-exif \ + --with-zip \ + --with-zlib \ + --with-zlib-dir=/usr \ + --enable-soap \ + --enable-xmlreader \ + --with-xsl \ + --with-tidy \ + --enable-sysvsem \ + --enable-sysvshm \ + --enable-shmop \ + --enable-pcntl \ + --with-readline \ + --enable-mbstring \ + --with-curl \ + --with-gettext \ + --enable-sockets \ + --with-bz2 \ + --with-openssl \ + --with-gmp \ + --enable-bcmath \ + --enable-calendar \ + --enable-ftp \ + --with-pspell=/usr \ + --with-kerberos \ + --enable-sysvmsg \ + --with-ffi \ + --enable-zend-test \ + --with-mhash \ + --with-sodium \ + --enable-dba \ + --enable-werror \ + --with-config-file-path=/etc \ + --with-config-file-scan-dir=/etc/php.d \ + ${{ inputs.configurationParameters }} + fi + if [ "$ARCH" == "macos" ]; then + export PATH="/usr/local/opt/bison/bin:$PATH" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/openssl@1.1/lib/pkgconfig" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/krb5/lib/pkgconfig" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libffi/lib/pkgconfig" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libxml2/lib/pkgconfig" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libxslt/lib/pkgconfig" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/zlib/lib/pkgconfig" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/icu4c/lib/pkgconfig" + ./buildconf --force + ./configure \ + --enable-option-checking=fatal \ + --prefix=/usr/local \ + --enable-fpm \ + --with-pdo-mysql=mysqlnd \ + --with-mysqli=mysqlnd \ + --with-pgsql=/usr/local/opt/libpq \ + --with-pdo-pgsql=/usr/local/opt/libpq \ + --with-pdo-sqlite \ + --without-pear \ + --enable-gd \ + --with-jpeg \ + --with-webp \ + --with-freetype \ + --enable-exif \ + --with-zip \ + --with-zlib \ + --enable-soap \ + --enable-xmlreader \ + --with-xsl \ + --with-tidy=/usr/local/opt/tidyp \ + --with-libxml \ + --enable-sysvsem \ + --enable-sysvshm \ + --enable-shmop \ + --enable-pcntl \ + --with-readline=/usr/local/opt/readline \ + --enable-mbstring \ + --with-curl \ + --with-gettext=/usr/local/opt/gettext \ + --enable-sockets \ + --with-bz2=/usr/local/opt/bzip2 \ + --with-openssl \ + --with-gmp=/usr/local/opt/gmp \ + --with-iconv=/usr/local/opt/libiconv \ + --enable-bcmath \ + --enable-calendar \ + --enable-ftp \ + --with-pspell=/usr/local/opt/aspell \ + --with-kerberos \ + --enable-sysvmsg \ + --with-ffi \ + --enable-zend-test \ + --enable-intl \ + --with-mhash \ + --with-sodium \ + --enable-dba \ + --enable-werror \ + --with-config-file-path=/etc \ + --with-config-file-scan-dir=/etc/php.d \ + ${{ inputs.configurationParameters }} + fi diff --git a/.github/actions/deps/action.yml b/.github/actions/deps/action.yml new file mode 100644 index 0000000000000..fc1b10d17ddcb --- /dev/null +++ b/.github/actions/deps/action.yml @@ -0,0 +1,135 @@ +name: Install dependencies +runs: + using: composite + steps: + - shell: bash + run: | + if [ "$ARCH" == "linux-x64" ]; then + sudo apt install bison \ + re2c \ + locales \ + ldap-utils \ + openssl \ + slapd \ + language-pack-de \ + libgmp-dev \ + libicu-dev \ + libtidy-dev \ + libenchant-dev \ + libaspell-dev \ + libpspell-dev \ + libsasl2-dev \ + libxpm-dev \ + libzip-dev \ + libsqlite3-dev \ + libwebp-dev \ + libonig-dev \ + libkrb5-dev \ + libgssapi-krb5-2 \ + libcurl4-openssl-dev \ + libxml2-dev \ + libxslt1-dev \ + libpq-dev \ + libreadline-dev \ + libldap2-dev \ + libsodium-dev \ + libargon2-0-dev \ + libmm-dev \ + libsnmp-dev \ + postgresql \ + postgresql-contrib \ + snmpd \ + snmp-mibs-downloader \ + freetds-dev \ + unixodbc-dev \ + llvm \ + libc-client-dev \ + dovecot-core \ + dovecot-pop3d \ + dovecot-imapd \ + sendmail \ + firebird-dev \ + liblmdb-dev \ + libtokyocabinet-dev \ + libdb-dev \ + libqdbm-dev \ + libjpeg-dev \ + libpng-dev \ + libfreetype6-dev + mkdir /opt/oracle + wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip + unzip instantclient-basiclite-linuxx64.zip + wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linuxx64.zip + unzip instantclient-sdk-linuxx64.zip + mv instantclient_*_* /opt/oracle/instantclient + # Interferes with libldap2 headers. + rm /opt/oracle/instantclient/sdk/include/ldap.h + fi + if [ "$ARCH" == "linux-i386" ]; then + sudo dpkg --add-architecture i386 + sudo apt-get update -y | true + sudo apt-get install -y gcc-multilib + sudo apt-get install -y g++-multilib + sudo apt-get purge -y libxml2 + # TODO: Reenable postgresql + postgresql-contrib packages once they work again. + sudo apt-get purge -y libpq5 + sudo apt-get install -y libc6:i386 + sudo apt-get install -y bison \ + re2c \ + locales \ + language-pack-de \ + libssl-dev:i386 \ + zlib1g-dev:i386 \ + libxml2-dev:i386 \ + libgmp-dev:i386 \ + libicu-dev:i386 \ + libtidy-dev:i386 \ + libaspell-dev:i386 \ + libpspell-dev:i386 \ + libsasl2-dev:i386 \ + libxpm-dev:i386 \ + libjpeg-dev:i386 \ + libpng-dev:i386 \ + libzip-dev:i386 \ + libbz2-dev:i386 \ + libsqlite3-dev:i386 \ + libwebp-dev:i386 \ + libonig-dev:i386 \ + libkrb5-dev:i386 \ + libgssapi-krb5-2:i386 \ + libcurl4-openssl-dev:i386 \ + libxml2-dev:i386 \ + libxslt1-dev:i386 \ + libpq-dev:i386 \ + libreadline-dev:i386 \ + libffi-dev:i386 \ + libfreetype6-dev:i386 \ + libsodium-dev:i386 + fi + if [ "$ARCH" == "macos" ]; then + brew install pkg-config \ + autoconf \ + bison \ + re2c + brew install openssl@1.1 \ + krb5 \ + bzip2 \ + enchant \ + libffi \ + libpng \ + webp \ + freetype \ + intltool \ + icu4c \ + libiconv \ + zlib \ + t1lib \ + gd \ + libzip \ + gmp \ + tidyp \ + libxml2 \ + libxslt \ + postgresql + brew link icu4c gettext --force + fi diff --git a/.github/actions/install-linux/action.yml b/.github/actions/install-linux/action.yml deleted file mode 100644 index ad8b95f795cc1..0000000000000 --- a/.github/actions/install-linux/action.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Install -runs: - using: composite - steps: - - shell: bash - run: | - set -e - 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 - echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini - echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml new file mode 100644 index 0000000000000..9413ce195e191 --- /dev/null +++ b/.github/actions/install/action.yml @@ -0,0 +1,18 @@ +name: Install +runs: + using: composite + steps: + - shell: bash + run: | + if [ "$ARCH" != "macos" ]; then + set -e + 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 + echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini + echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini + else + sudo make install + fi diff --git a/.github/actions/linux-x64/action.yml b/.github/actions/linux-x64/action.yml deleted file mode 100644 index d1192b43b416e..0000000000000 --- a/.github/actions/linux-x64/action.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Linux x64 -inputs: - configurationParameters: - required: true - extendedTests: - required: true -runs: - using: composite - steps: - - name: git checkout - uses: actions/checkout@v2 - - name: Create mssql container - uses: ./.github/actions/mssql - - name: apt - uses: ./.github/actions/apt-x64 - - name: ./configure - uses: ./.github/actions/configure-x64 - with: - configurationParameters: ${{ inputs.configurationParameters }} - - name: make - shell: bash - run: make -j$(/usr/bin/nproc) >/dev/null - - name: make install - uses: ./.github/actions/install-linux - - name: Setup - uses: ./.github/actions/setup-x64 - - name: Test - uses: ./.github/actions/tests-linux - with: - extended: ${{ inputs.extendedTests }} diff --git a/.github/actions/macos/action.yml b/.github/actions/macos/action.yml deleted file mode 100644 index 06c2bc1af693a..0000000000000 --- a/.github/actions/macos/action.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: macos -inputs: - configurationParameters: - required: true - extendedTests: - required: true -runs: - using: composite - steps: - - name: git checkout - uses: actions/checkout@v2 - - name: brew - uses: ./.github/actions/brew - - name: ./configure - uses: ./.github/actions/configure-macos - with: - configurationParameters: ${{ inputs.configurationParameters }} - - name: make - shell: bash - run: | - export PATH="/usr/local/opt/bison/bin:$PATH" - make -j$(sysctl -n hw.logicalcpu) >/dev/null - - name: make - shell: bash - run: sudo make install - - name: Setup - uses: ./.github/actions/setup-x64 - - name: Test - uses: ./.github/actions/tests-linux - with: - extended: ${{ inputs.extendedTests }} diff --git a/.github/actions/setup-i386/action.yml b/.github/actions/setup-i386/action.yml deleted file mode 100644 index 664c911a71aec..0000000000000 --- a/.github/actions/setup-i386/action.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: apt -runs: - using: composite - steps: - - shell: bash - run: | - set -e - sudo service mysql start - mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" - #sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';" - #sudo -u postgres psql -c "CREATE DATABASE test;" diff --git a/.github/actions/setup-x64/action.yml b/.github/actions/setup-x64/action.yml deleted file mode 100644 index 80b5a0bbef3e3..0000000000000 --- a/.github/actions/setup-x64/action.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: apt -runs: - using: composite - steps: - - shell: bash - run: | - set -e - sudo service mysql start - sudo service postgresql start - sudo service slapd start - mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" - # Ensure local_infile tests can run. - mysql -uroot -proot -e "SET GLOBAL local_infile = true" - sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';" - sudo -u postgres psql -c "CREATE DATABASE test;" - docker exec sql1 /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U SA -P "" -Q "create login pdo_test with password='password', check_policy=off; create user pdo_test for login pdo_test; grant alter, control to pdo_test;" - sudo locale-gen de_DE - - ./.github/scripts/setup-slapd.sh - - set -e - sudo cp ext/snmp/tests/snmpd.conf /etc/snmp - sudo cp ext/snmp/tests/bigtest /etc/snmp - sudo service snmpd restart - - set -e - sudo groupadd -g 5000 vmail - sudo useradd -m -d /var/vmail -s /bin/false -u 5000 -g vmail vmail - sudo cp ext/imap/tests/setup/dovecot.conf /etc/dovecot/dovecot.conf - sudo cp ext/imap/tests/setup/dovecotpass /etc/dovecot/dovecotpass - sudo service dovecot restart diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 0000000000000..227b105464d94 --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,34 @@ +name: Setup +runs: + using: composite + steps: + - shell: bash + run: | + set -e + sudo service mysql start + mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" + + if [ "$ARCH" == "linux-x64" ]; then + sudo service postgresql start + sudo service slapd start + # Ensure local_infile tests can run. + mysql -uroot -proot -e "SET GLOBAL local_infile = true" + sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';" + sudo -u postgres psql -c "CREATE DATABASE test;" + docker exec sql1 /opt/mssql-tools/bin/sqlcmd -S 127.0.0.1 -U SA -P "" -Q "create login pdo_test with password='password', check_policy=off; create user pdo_test for login pdo_test; grant alter, control to pdo_test;" + sudo locale-gen de_DE + + ./.github/scripts/setup-slapd.sh + + set -e + sudo cp ext/snmp/tests/snmpd.conf /etc/snmp + sudo cp ext/snmp/tests/bigtest /etc/snmp + sudo service snmpd restart + + set -e + sudo groupadd -g 5000 vmail + sudo useradd -m -d /var/vmail -s /bin/false -u 5000 -g vmail vmail + sudo cp ext/imap/tests/setup/dovecot.conf /etc/dovecot/dovecot.conf + sudo cp ext/imap/tests/setup/dovecotpass /etc/dovecot/dovecotpass + sudo service dovecot restart + fi diff --git a/.github/actions/test-linux/action.yml b/.github/actions/test-linux/action.yml deleted file mode 100644 index 8fb8d6df60265..0000000000000 --- a/.github/actions/test-linux/action.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: apt -inputs: - runTestsParameters: - default: '' - required: false -runs: - using: composite - steps: - - shell: bash - run: | - export MYSQL_TEST_USER=root - export MYSQL_TEST_PASSWD=root - export PDO_MYSQL_TEST_DSN="mysql:host=localhost;dbname=test" - export PDO_MYSQL_TEST_USER=root - export PDO_MYSQL_TEST_PASS=root - export PDO_DBLIB_TEST_DSN="dblib:host=127.0.0.1;dbname=master;version=7.0" - export PDO_DBLIB_TEST_USER="pdo_test" - export PDO_DBLIB_TEST_PASS="password" - export REPORT_EXIT_STATUS=no - export SKIP_IO_CAPTURE_TESTS=1 - sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \ - -j$(/usr/bin/nproc) \ - -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP \ - --offline \ - --show-diff \ - --show-slow 1000 \ - --set-timeout 120 diff --git a/.github/actions/test-macos/action.yml b/.github/actions/test-macos/action.yml deleted file mode 100644 index 19eb5cbda202b..0000000000000 --- a/.github/actions/test-macos/action.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: apt -inputs: - runTestsParameters: - default: '' - required: false -runs: - using: composite - steps: - - shell: bash - run: | - export REPORT_EXIT_STATUS=no - export SKIP_IO_CAPTURE_TESTS=1 - export CI_NO_IPV6=1 - sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \ - -j$(sysctl -n hw.ncpu) \ - -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP \ - --offline \ - --show-diff \ - --show-slow 1000 \ - --set-timeout 120 diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml new file mode 100644 index 0000000000000..ee1d353eb01f2 --- /dev/null +++ b/.github/actions/test/action.yml @@ -0,0 +1,32 @@ +name: Test +inputs: + runTestsParameters: + default: '' + required: false +runs: + using: composite + steps: + - shell: bash + run: | + if [ "$ARCH" != "macos" ]; then + export MYSQL_TEST_USER=root + export MYSQL_TEST_PASSWD=root + export PDO_MYSQL_TEST_DSN="mysql:host=localhost;dbname=test" + export PDO_MYSQL_TEST_USER=root + export PDO_MYSQL_TEST_PASS=root + export PDO_DBLIB_TEST_DSN="dblib:host=127.0.0.1;dbname=master;version=7.0" + export PDO_DBLIB_TEST_USER="pdo_test" + export PDO_DBLIB_TEST_PASS="password" + fi + if [ "$ARCH" == "macos" ]; then + export CI_NO_IPV6=1 + fi + export REPORT_EXIT_STATUS=no + export SKIP_IO_CAPTURE_TESTS=1 + sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \ + -j$(/usr/bin/nproc) \ + -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP \ + --offline \ + --show-diff \ + --show-slow 1000 \ + --set-timeout 120 diff --git a/.github/actions/tests-linux/action.yml b/.github/actions/tests-linux/action.yml deleted file mode 100644 index e8fb34fee58b9..0000000000000 --- a/.github/actions/tests-linux/action.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Tests Linux -inputs: - extended: - required: true - runTestsParameters: - default: '' - required: false -runs: - using: composite - steps: - - uses: ./.github/actions/linux-test - with: - runTestsParameters: ${{ inputs.runTestsParameters }} - - name: Tracing JIT - uses: ./.github/actions/linux-test - with: - runTestsParameters: '${{ inputs.runTestsParameters }} -d zend_extension=opcache.so -d opcache.jit_buffer_size=16M' - - name: OpCache - if: ${{ inputs.extended }} - uses: ./.github/actions/linux-test - with: - runTestsParameters: '${{ inputs.runTestsParameters }} -d zend_extension=opcache.so' - - name: Function JIT - if: ${{ inputs.extended }} - uses: ./.github/actions/linux-test - with: - runTestsParameters: '${{ inputs.runTestsParameters }} -d zend_extension=opcache.so -d opcache.jit_buffer_size=16M -d opcache.jit=1205' diff --git a/.github/actions/tests-macos/action.yml b/.github/actions/tests/action.yml similarity index 53% rename from .github/actions/tests-macos/action.yml rename to .github/actions/tests/action.yml index 1d8ee06776143..0a93c66ed067b 100644 --- a/.github/actions/tests-macos/action.yml +++ b/.github/actions/tests/action.yml @@ -1,4 +1,4 @@ -name: Tests macos +name: Tests inputs: extended: required: true @@ -8,20 +8,20 @@ inputs: runs: using: composite steps: - - uses: ./.github/actions/macos-test + - uses: ./.github/actions/test with: runTestsParameters: ${{ inputs.runTestsParameters }} - name: Tracing JIT - uses: ./.github/actions/macos-test + uses: ./.github/actions/test with: - runTestsParameters: '${{ inputs.runTestsParameters }} -d zend_extension=opcache.so -d opcache.protect_memory=1 -d opcache.jit_buffer_size=16M' + runTestsParameters: '${{ inputs.runTestsParameters }} -d zend_extension=opcache.so ${{ env.ARCH == 'macos' && '-d opcache.protect_memory=1' }} -d opcache.jit_buffer_size=16M' - name: OpCache if: ${{ inputs.extended }} - uses: ./.github/actions/macos-test + uses: ./.github/actions/test with: - runTestsParameters: '${{ inputs.runTestsParameters }} -d zend_extension=opcache.so -d opcache.protect_memory=1' + runTestsParameters: '${{ inputs.runTestsParameters }} -d zend_extension=opcache.so ${{ env.ARCH == 'macos' && '-d opcache.protect_memory=1' }}' - name: Function JIT if: ${{ inputs.extended }} - uses: ./.github/actions/macos-test + uses: ./.github/actions/test with: - runTestsParameters: '${{ inputs.runTestsParameters }} -d zend_extension=opcache.so -d opcache.protect_memory=1 -d opcache.jit_buffer_size=16M -d opcache.jit=1205' + runTestsParameters: '${{ inputs.runTestsParameters }} -d zend_extension=opcache.so ${{ env.ARCH == 'macos' && '-d opcache.protect_memory=1' }} -d opcache.jit_buffer_size=16M -d opcache.jit=1205' diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 34865b513d3d9..5c6b0ba573aed 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -15,23 +15,52 @@ jobs: matrix: include: - name: LINUX_X64_DEBUG_NTS - action: linux-x64 + arch: linux-x64 + runs-on: ubuntu-20.04 configurationParameters: --enable-debug --disable-zts - name: LINUX_X64_RELEASE_ZTS - action: linux-x64 + arch: linux-x64 + runs-on: ubuntu-20.04 configurationParameters: --disable-debug --enable-zts # apt broken, not sure why # - name: LINUX_I386_DEBUG_ZTS - # action: linux-i386 + # arch: linux-i386 + # runs-on: ubuntu-20.04 # configurationParameters: --enable-debug --disable-zts - name: MACOS_DEBUG_NTS - action: macos + arch: macos + runs-on: macOS-10.15 configurationParameters: --enable-debug --disable-zts fail-fast: false name: ${{ matrix.name }} runs-on: ${{ matrix['runs-on'] }} + env: + ARCH: ${{ matrix.arch }} steps: - - uses: ${{ matrix.action }} + - name: git checkout + uses: actions/checkout@v2 + - name: Create mssql container + if: ${{ env.ARCH != 'macos' }} + uses: ./.github/actions/mssql + - name: Install dependencies + uses: ./.github/actions/deps + - name: ./configure + uses: ./.github/actions/configure with: configurationParameters: ${{ matrix.configurationParameters }} - extendedTests: false + - name: make + shell: bash + run: | + if [ "$ARCH" == "macos" ]; then + export PATH="/usr/local/opt/bison/bin:$PATH" + fi + make ${{ env.ARCH != 'macos' && '-j$(/usr/bin/nproc)' || '-j$(sysctl -n hw.logicalcpu)' }} >/dev/null + - name: make install + uses: ./.github/actions/install + - name: Setup + if: ${{ env.ARCH != 'macos' }} + uses: ./.github/actions/setup + - name: Test + uses: ./.github/actions/tests + with: + extended: ${{ inputs.extendedTests }} From 0c272b9a1bd4a72531b2defe1e94bcbfec687dae Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Fri, 11 Feb 2022 16:57:22 +0100 Subject: [PATCH 4/7] wip --- .github/actions/test/action.yml | 2 +- .github/actions/tests/action.yml | 6 +-- .github/nightly_matrix.php | 47 +++++++++++++++++++++++ .github/workflows/nightly.yml | 65 ++++++++++++++++++++++++++++++++ .github/workflows/push.yml | 23 ++++++----- 5 files changed, 127 insertions(+), 16 deletions(-) create mode 100644 .github/nightly_matrix.php create mode 100644 .github/workflows/nightly.yml diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index ee1d353eb01f2..87607116a8900 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -24,7 +24,7 @@ runs: export REPORT_EXIT_STATUS=no export SKIP_IO_CAPTURE_TESTS=1 sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \ - -j$(/usr/bin/nproc) \ + -j$(${{ env.ARCH != 'macos' && '/usr/bin/nproc' || 'sysctl -n hw.logicalcpu' }}) \ -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP \ --offline \ --show-diff \ diff --git a/.github/actions/tests/action.yml b/.github/actions/tests/action.yml index 0a93c66ed067b..56d57738d13b5 100644 --- a/.github/actions/tests/action.yml +++ b/.github/actions/tests/action.yml @@ -14,14 +14,14 @@ runs: - name: Tracing JIT uses: ./.github/actions/test with: - runTestsParameters: '${{ inputs.runTestsParameters }} -d zend_extension=opcache.so ${{ env.ARCH == 'macos' && '-d opcache.protect_memory=1' }} -d opcache.jit_buffer_size=16M' + runTestsParameters: "${{ inputs.runTestsParameters }} -d zend_extension=opcache.so ${{ env.ARCH == 'macos' && '-d opcache.protect_memory=1' }} -d opcache.jit_buffer_size=16M" - name: OpCache if: ${{ inputs.extended }} uses: ./.github/actions/test with: - runTestsParameters: '${{ inputs.runTestsParameters }} -d zend_extension=opcache.so ${{ env.ARCH == 'macos' && '-d opcache.protect_memory=1' }}' + runTestsParameters: "${{ inputs.runTestsParameters }} -d zend_extension=opcache.so ${{ env.ARCH == 'macos' && '-d opcache.protect_memory=1' }}" - name: Function JIT if: ${{ inputs.extended }} uses: ./.github/actions/test with: - runTestsParameters: '${{ inputs.runTestsParameters }} -d zend_extension=opcache.so ${{ env.ARCH == 'macos' && '-d opcache.protect_memory=1' }} -d opcache.jit_buffer_size=16M -d opcache.jit=1205' + runTestsParameters: "${{ inputs.runTestsParameters }} -d zend_extension=opcache.so ${{ env.ARCH == 'macos' && '-d opcache.protect_memory=1' }} -d opcache.jit_buffer_size=16M -d opcache.jit=1205" diff --git a/.github/nightly_matrix.php b/.github/nightly_matrix.php new file mode 100644 index 0000000000000..4de69976e6bff --- /dev/null +++ b/.github/nightly_matrix.php @@ -0,0 +1,47 @@ + $name, + 'branch' => $branch, + 'arch' => $arch, + 'configurationParameters' => $configuration_parameters, + ]; + } + } + } + } + + return ['include' => $result]; +} + +echo '::set-output name=matrix::' . json_encode(get_matrix(), JSON_UNESCAPED_SLASHES) . "\n"; diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000000000..cf7aa48011502 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,65 @@ +name: Nightly +# Update to only run on a schedule +on: + push: + ignore-paths: + - docs/* + - NEWS + - UPGRADING + - UPGRADING.INTERNALS + - README.md + - CONTRIBUTING.md + - CODING_STANDARDS.md +jobs: + generate-matrix: + name: Generate Build Matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Generate Build Matrix + id: set-matrix + run: php .github/nightly_matrix.php + test: + needs: generate-matrix + strategy: + matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} + fail-fast: false + name: ${{ matrix.name }} + runs-on: ${{ startsWith(matrix['arch'], 'linux-') && 'ubuntu-20.04' || 'macOS-10.15' }} + env: + ARCH: ${{ matrix.arch }} + steps: + - name: git checkout + uses: actions/checkout@v2 + # Only test on current branch until merged + # with: + # ref: ${{ matrix.branch }} + - name: Create mssql container + if: ${{ env.ARCH != 'macos' }} + uses: ./.github/actions/mssql + - name: Install dependencies + uses: ./.github/actions/deps + - name: ./configure + uses: ./.github/actions/configure + with: + configurationParameters: ${{ matrix.configurationParameters }} + - name: make + shell: bash + run: | + if [ "$ARCH" == "macos" ]; then + export PATH="/usr/local/opt/bison/bin:$PATH" + fi + make -j$(${{ env.ARCH != 'macos' && '/usr/bin/nproc' || 'sysctl -n hw.logicalcpu' }}) >/dev/null + - name: make install + uses: ./.github/actions/install + - name: Setup + if: ${{ env.ARCH != 'macos' }} + uses: ./.github/actions/setup + - name: Test + uses: ./.github/actions/tests + with: + extended: ${{ inputs.extendedTests }} diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 5c6b0ba573aed..c40d7f371eb3a 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -2,13 +2,16 @@ name: Push on: push: ignore-paths: - - docs/* - - NEWS - - UPGRADING - - UPGRADING.INTERNALS - - README.md - - CONTRIBUTING.md - - CODING_STANDARDS.md + - docs/* + - NEWS + - UPGRADING + - UPGRADING.INTERNALS + - README.md + - CONTRIBUTING.md + - CODING_STANDARDS.md + # Ignore while testing nightly + branches-ignore: + - '**' jobs: test: strategy: @@ -16,24 +19,20 @@ jobs: include: - name: LINUX_X64_DEBUG_NTS arch: linux-x64 - runs-on: ubuntu-20.04 configurationParameters: --enable-debug --disable-zts - name: LINUX_X64_RELEASE_ZTS arch: linux-x64 - runs-on: ubuntu-20.04 configurationParameters: --disable-debug --enable-zts # apt broken, not sure why # - name: LINUX_I386_DEBUG_ZTS # arch: linux-i386 - # runs-on: ubuntu-20.04 # configurationParameters: --enable-debug --disable-zts - name: MACOS_DEBUG_NTS arch: macos - runs-on: macOS-10.15 configurationParameters: --enable-debug --disable-zts fail-fast: false name: ${{ matrix.name }} - runs-on: ${{ matrix['runs-on'] }} + runs-on: ${{ startsWith(matrix['arch'], 'linux-') && 'ubuntu-20.04' || 'macOS-10.15' }} env: ARCH: ${{ matrix.arch }} steps: From 91f94a9eb840dd0a2acfaeaec46b7ea99e91ed50 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Fri, 11 Feb 2022 18:54:23 +0100 Subject: [PATCH 5/7] Add remaining tests --- .github/actions/libmysql-test/action.yml | 64 ++++ .github/nightly_matrix.php | 46 ++- .github/workflows/nightly.yml | 385 +++++++++++++++++++++-- 3 files changed, 472 insertions(+), 23 deletions(-) create mode 100644 .github/actions/libmysql-test/action.yml diff --git a/.github/actions/libmysql-test/action.yml b/.github/actions/libmysql-test/action.yml new file mode 100644 index 0000000000000..c84d544bd5ca8 --- /dev/null +++ b/.github/actions/libmysql-test/action.yml @@ -0,0 +1,64 @@ +name: libmysqlclient test +inputs: + configurationName: + default: '' + required: false + configurationParameters: + default: '' + required: false + libmysql: + default: '' + required: false +runs: + using: composite + steps: + - name: Build ${{ inputs.configurationName }} + if: always() + shell: bash + run: | + set -e + LIBMYSQL=${{ inputs.libmysql }} + MYSQL_BASE=${LIBMYSQL%%-linux-*} + MYSQL_VERSION=${MYSQL_BASE#*-} + MYSQL_DIR=$HOME/$MYSQL_BASE + mkdir -p $MYSQL_DIR + URL=https://cdn.mysql.com/Downloads/MySQL-${MYSQL_VERSION%.*}/$LIBMYSQL + wget -nv $URL + tar -xf $LIBMYSQL --strip-components=1 -C $MYSQL_DIR + PDO_MYSQL=${MYSQL_DIR} + MYSQLI=${MYSQL_DIR}/bin/mysql_config + ./buildconf --force + ./configure ${{ inputs.configurationParameters }} \ + --enable-option-checking=fatal \ + --disable-all \ + --enable-pdo \ + --with-pdo-mysql=${PDO_MYSQL} \ + --with-mysqli=${MYSQLI} + make clean + make -j$(/usr/bin/nproc) >/dev/null + - name: Test ${{ inputs.configurationName }} + if: always() + shell: bash + run: | + export MYSQL_TEST_USER=root + export MYSQL_TEST_PASSWD=root + export PDO_MYSQL_TEST_DSN="mysql:host=127.0.0.1;dbname=test" + export PDO_MYSQL_TEST_HOST=127.0.0.1 + export PDO_MYSQL_TEST_USER=root + export PDO_MYSQL_TEST_PASS=root + export TEST_PHP_JUNIT=junit.xml + export REPORT_EXIT_STATUS=no + rm -rf junit.xml | true + sapi/cli/php run-tests.php -P -q \ + -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP \ + --offline --show-diff --show-slow 1000 --set-timeout 120 \ + ext/pdo_mysql + # FIXME + # - task: PublishTestResults@2 + # inputs: + # testResultsFormat: 'JUnit' + # testResultsFiles: junit.xml + # testRunTitle: '${{ inputs.configurationName }}' + # failTaskOnFailedTests: true + # displayName: 'Export ${{ inputs.configurationName }} Results' + # condition: or(succeeded(), failed()) diff --git a/.github/nightly_matrix.php b/.github/nightly_matrix.php index 4de69976e6bff..1aa7fbb284d9c 100644 --- a/.github/nightly_matrix.php +++ b/.github/nightly_matrix.php @@ -13,14 +13,15 @@ function get_branches() { }); } -function get_matrix() { +function get_test_matrix($branches) { $result = []; - foreach (get_branches() as $branch) { + foreach ($branches as $branch) { + $branch_key = strtoupper(str_replace('.', '', $branch)); + foreach (ARCHES as $arch) { foreach ([true, false] as $debug) { foreach ([true, false] as $zts) { - $branch_key = strtoupper(str_replace('.', '', $branch)); $arch_key = strtoupper($arch); $debug_key = $debug ? 'DEBUG' : 'RELEASE'; $zts_key = $zts ? 'ZTS' : 'NTS'; @@ -39,9 +40,46 @@ function get_matrix() { } } } + + $result[] = [ + 'name' => $branch_key . '_LINUX_X64_DEBUG_ZTS_ASAN_UBSAN', + 'branch' => $branch, + 'arch' => 'linux-x64', + 'configurationParameters' => '--enable-debug --enable-zts --enable-address-sanitizer --enable-undefined-sanitizer', + 'runTestsParameters' => '--asan', + ]; + + $result[] = [ + 'name' => $branch_key . '_LINUX_X64_DEBUG_NTS_REPEAT', + 'branch' => $branch, + 'arch' => 'linux-x64', + 'configurationParameters' => '--enable-debug --disable-zts', + 'runTestsParameters' => '--repeat 2', + ]; + + $result[] = [ + 'name' => $branch_key . '_LINUX_X64_VARIATION_DEBUG_ZTS', + 'branch' => $branch, + 'arch' => 'linux-x64', + 'configurationParameters' => '--enable-debug --enable-zts CFLAGS="-DZEND_RC_DEBUG=1 -DPROFITABILITY_CHECKS=0 -DZEND_VERIFY_FUNC_INFO=1"', + ]; } return ['include' => $result]; } -echo '::set-output name=matrix::' . json_encode(get_matrix(), JSON_UNESCAPED_SLASHES) . "\n"; +function get_branch_matrix($branches) { + $result = array_map(function ($branch) { + $branch_key = strtoupper(str_replace('.', '', $branch)); + return [ + 'name' => $branch_key, + 'branch' => $branch, + ]; + }, $branches); + + return ['branches' => $result]; +} + +$branches = get_branches(); +echo '::set-output name=branch_matrix::' . json_encode(get_branch_matrix($branches), JSON_UNESCAPED_SLASHES) . "\n"; +echo '::set-output name=test_matrix::' . json_encode(get_test_matrix($branches), JSON_UNESCAPED_SLASHES) . "\n"; diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index cf7aa48011502..9a3425a75db56 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -11,27 +11,256 @@ on: - CONTRIBUTING.md - CODING_STANDARDS.md jobs: - generate-matrix: + generate_matrix: name: Generate Build Matrix runs-on: ubuntu-latest outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} + test_matrix: ${{ steps.set-matrix.outputs.test_matrix }} + branch_matrix: ${{ steps.set-matrix.outputs.branch_matrix }} steps: - uses: actions/checkout@v2 with: fetch-depth: 0 - - name: Generate Build Matrix - id: set-matrix + - name: Generate Matrix + id: set_matrix run: php .github/nightly_matrix.php - test: - needs: generate-matrix + # run_tests: + # needs: generate_matrix + # strategy: + # matrix: ${{ fromJson(needs.generate_matrix.outputs.test_matrix) }} + # fail-fast: false + # name: ${{ matrix.name }} + # runs-on: ${{ startsWith(matrix.arch, 'linux-') && 'ubuntu-20.04' || 'macOS-10.15' }} + # env: + # ARCH: ${{ matrix.arch }} + # steps: + # - name: git checkout + # uses: actions/checkout@v2 + # # Only test on current branch until merged + # # with: + # # ref: ${{ matrix.branch }} + # - name: Create mssql container + # if: ${{ env.ARCH != 'macos' }} + # uses: ./.github/actions/mssql + # - name: Install dependencies + # uses: ./.github/actions/deps + # - name: ./configure + # uses: ./.github/actions/configure + # with: + # configurationParameters: ${{ matrix.configurationParameters }} + # - name: make + # run: | + # if [ "$ARCH" == "macos" ]; then + # export PATH="/usr/local/opt/bison/bin:$PATH" + # fi + # make -j$(${{ env.ARCH != 'macos' && '/usr/bin/nproc' || 'sysctl -n hw.logicalcpu' }}) >/dev/null + # - name: make install + # uses: ./.github/actions/install + # - name: Setup + # if: ${{ env.ARCH != 'macos' }} + # uses: ./.github/actions/setup + # - name: Test + # uses: ./.github/actions/tests + # with: + # extended: ${{ inputs.extendedTests }} + # runTestsParameters: ${{ inputs.runTestsParameters }} + debug_zts_msan: + needs: generate_matrix strategy: - matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} + matrix: ${{ fromJson(needs.generate_matrix.outputs.branch_matrix) }} fail-fast: false name: ${{ matrix.name }} - runs-on: ${{ startsWith(matrix['arch'], 'linux-') && 'ubuntu-20.04' || 'macOS-10.15' }} + runs-on: ubuntu-20.04 env: - ARCH: ${{ matrix.arch }} + arch: linux-x64 + steps: + - name: git checkout + uses: actions/checkout@v2 + # Only test on current branch until merged + # with: + # ref: ${{ matrix.branch }} + - name: Install dependencies + uses: ./.github/actions/deps + - name: ./configure + run: | + export CC=clang + export CXX=clang++ + export CFLAGS="-DZEND_TRACK_ARENA_ALLOC" + ./buildconf --force + # msan requires all used libraries to be instrumented, + # so we should avoiding linking against anything but libc here + ./configure \ + --enable-debug \ + --enable-zts + --enable-option-checking=fatal \ + --prefix=/usr \ + --without-sqlite3 \ + --without-pdo-sqlite \ + --without-libxml \ + --disable-dom \ + --disable-simplexml \ + --disable-xml \ + --disable-xmlreader \ + --disable-xmlwriter \ + --without-pcre-jit \ + --disable-opcache-jit \ + --enable-phpdbg \ + --enable-fpm \ + --with-pdo-mysql=mysqlnd \ + --with-mysqli=mysqlnd \ + --disable-mysqlnd-compression-support \ + --without-pear \ + --enable-exif \ + --enable-sysvsem \ + --enable-sysvshm \ + --enable-shmop \ + --enable-pcntl \ + --enable-mbstring \ + --disable-mbregex \ + --enable-sockets \ + --enable-bcmath \ + --enable-calendar \ + --enable-ftp \ + --enable-zend-test \ + --enable-werror \ + --enable-memory-sanitizer \ + --with-config-file-path=/etc \ + --with-config-file-scan-dir=/etc/php.d + - name: make + run: make -j$(/usr/bin/nproc) >/dev/null + - name: make install + uses: ./.github/actions/install + - name: Setup + uses: ./.github/actions/setup + - name: mysql + # FIXME: Can we reuse the setup action? + run: | + sudo service mysql start + mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" + - name: Test + uses: ./.github/actions/tests + with: + extended: false + runTestsParameters: '--msan' + community: + needs: generate_matrix + strategy: + matrix: ${{ fromJson(needs.generate_matrix.outputs.branch_matrix) }} + fail-fast: false + name: ${{ matrix.name }} + runs-on: ubuntu-20.04 + env: + arch: linux-x64 + steps: + - name: git checkout + uses: actions/checkout@v2 + # Only test on current branch until merged + # with: + # ref: ${{ matrix.branch }} + - name: Install dependencies + uses: ./.github/actions/deps + - name: ./configure + uses: ./.github/actions/configure + with: + configurationParameters: >- + --enable-debug --enable-zts --enable-address-sanitizer --enable-undefined-sanitizer + CFLAGS="-fno-sanitize-recover" + - name: make + run: make -j$(/usr/bin/nproc) >/dev/null + - name: make install + uses: ./.github/actions/install + - name: Enable OpCache and JIT + run: | + # Run with opcache to also catch optimizer bugs. + echo zend_extension=opcache.so > /etc/php.d/opcache.ini + echo opcache.jit_buffer_size=1G >> /etc/php.d/opcache.ini + - name: mysql + # FIXME: Can we reuse the setup action? + run: | + sudo service mysql start + mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" + - name: Test + uses: ./.github/actions/tests + with: + extended: false + runTestsParameters: '--msan' + - name: Test Laravel + run: | + 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 + - name: Test Symfony + if: always() + run: | + 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 + - name: Test Amphp + if: always() + run: | + 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 + - name: Test PHPUnit + if: always() + run: | + 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 + - name: Symfony Preloading + if: always() + run: | + 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 + coverage: + needs: generate_matrix + strategy: + matrix: ${{ fromJson(needs.generate_matrix.outputs.branch_matrix) }} + fail-fast: false + name: ${{ matrix.name }} + runs-on: ubuntu-20.04 + env: + arch: linux-x64 steps: - name: git checkout uses: actions/checkout@v2 @@ -39,27 +268,145 @@ jobs: # with: # ref: ${{ matrix.branch }} - name: Create mssql container - if: ${{ env.ARCH != 'macos' }} uses: ./.github/actions/mssql - name: Install dependencies uses: ./.github/actions/deps + - name: Install gcovr + run: sudo -H pip install gcovr - name: ./configure uses: ./.github/actions/configure with: - configurationParameters: ${{ matrix.configurationParameters }} + configurationParameters: --enable-debug --disable-zts --enable-gcov - name: make - shell: bash + run: make -j$(/usr/bin/nproc) >/dev/null + - name: make install + uses: ./.github/actions/install + - name: Setup + uses: ./.github/actions/setup + - name: Test + uses: ./.github/actions/test + with: + runTestsParameters: -d zend_extension=opcache.so + - name: 'Upload Test Coverage to Codecov.io' + if: always() + run: bash <(curl -s https://codecov.io/bash) + - name: 'Generate Test Coverage Cobertura XML Report' + if: always() run: | - if [ "$ARCH" == "macos" ]; then - export PATH="/usr/local/opt/bison/bin:$PATH" - fi - make -j$(${{ env.ARCH != 'macos' && '/usr/bin/nproc' || 'sysctl -n hw.logicalcpu' }}) >/dev/null + make gcovr-xml + mv gcovr.xml coverage.xml + # FIXME: What's the equivalent for GitHub actions? + # - name: 'Publish Test Coverage' + # if: always() + # task: PublishCodeCoverageResults@1 + # inputs: + # codeCoverageTool: 'Cobertura' + # summaryFileLocation: coverage.xml + opcache_variation: + needs: generate_matrix + strategy: + matrix: ${{ fromJson(needs.generate_matrix.outputs.branch_matrix) }} + fail-fast: false + name: ${{ matrix.name }} + runs-on: ubuntu-20.04 + env: + arch: linux-x64 + steps: + - name: git checkout + uses: actions/checkout@v2 + # Only test on current branch until merged + # with: + # ref: ${{ matrix.branch }} + - name: Create mssql container + uses: ./.github/actions/mssql + - name: Install dependencies + uses: ./.github/actions/deps + - name: ./configure + uses: ./.github/actions/configure + with: + configurationParameters: --enable-debug --disable-zts + - name: make + run: make -j$(/usr/bin/nproc) >/dev/null - name: make install uses: ./.github/actions/install - name: Setup - if: ${{ env.ARCH != 'macos' }} uses: ./.github/actions/setup - name: Test - uses: ./.github/actions/tests + uses: ./.github/actions/test + with: + runTestsParameters: -d zend_extension=opcache.so --file-cache-prime + - name: Test + uses: ./.github/actions/test + with: + runTestsParameters: -d zend_extension=opcache.so --file-cache-use + - name: Test + uses: ./.github/actions/test + with: + runTestsParameters: -d zend_extension=opcache.so --file-cache-use + - name: Test + uses: ./.github/actions/test + with: + runTestsParameters: -d zend_extension=opcache.so --file-cache-use -d opcache.file_cache_only=1 + - name: Test + uses: ./.github/actions/test + with: + runTestsParameters: -d zend_extension=opcache.so --file-cache-prime -d opcache.file_cache_only=1 + - name: Test + uses: ./.github/actions/test + with: + runTestsParameters: -d zend_extension=opcache.so --file-cache-use -d opcache.file_cache_only=1 + - name: Test + uses: ./.github/actions/test + with: + runTestsParameters: -d zend_extension=opcache.so --file-cache-use + - name: Test + uses: ./.github/actions/test + with: + runTestsParameters: -d zend_extension=opcache.so -d opcache.interned_strings_buffer=0 + - name: Test + uses: ./.github/actions/test + with: + runTestsParameters: -d zend_extension=opcache.so --preload + libmysqlclient_debug_nts: + needs: generate_matrix + strategy: + matrix: ${{ fromJson(needs.generate_matrix.outputs.branch_matrix) }} + fail-fast: false + name: ${{ matrix.name }} + runs-on: ubuntu-20.04 + env: + arch: linux-x64 + steps: + - name: git checkout + uses: actions/checkout@v2 + # Only test on current branch until merged + # with: + # ref: ${{ matrix.branch }} + - name: Install dependencies + run: | + sudo apt-get update -y | true + sudo apt install bison re2c + - name: Setup MySQL server + run: | + set -o + sudo service mysql start + mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" + # Ensure local_infile tests can run. + mysql -uroot -proot -e "SET GLOBAL local_infile = true" + # Does not support caching_sha2_auth :( + # - uses: ./.github/actions/libmysql-test + # with: + # configurationName: LIBMYSQLCLIENT_DEBUG_NTS - MySQL 5.6.49 + # libmysql: mysql-5.6.49-linux-glibc2.12-x86_64.tar.gz + - uses: ./.github/actions/libmysql-test + with: + runTestsParameters: -d zend_extension=opcache.so --preload + - uses: ./.github/actions/libmysql-test + with: + configurationName: LIBMYSQLCLIENT_DEBUG_NTS - MySQL 5.7.35 + libmysql: mysql-5.7.35-linux-glibc2.12-x86_64.tar.gz + - uses: ./.github/actions/libmysql-test with: - extended: ${{ inputs.extendedTests }} + configurationName: LIBMYSQLCLIENT_DEBUG_NTS - MySQL 8.0.27 + libmysql: mysql-8.0.27-linux-glibc2.12-x86_64.tar.xz + configurationParameters: --enable-debug --disable-zts --enable-werror From 140336be517e860b95aff811bcd97e3125d24342 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Fri, 11 Feb 2022 19:13:36 +0100 Subject: [PATCH 6/7] wip --- .github/nightly_matrix.php | 4 +- .github/workflows/nightly.yml | 101 +++++++++++++++------------------- 2 files changed, 47 insertions(+), 58 deletions(-) diff --git a/.github/nightly_matrix.php b/.github/nightly_matrix.php index 1aa7fbb284d9c..08f153716da02 100644 --- a/.github/nightly_matrix.php +++ b/.github/nightly_matrix.php @@ -73,11 +73,11 @@ function get_branch_matrix($branches) { $branch_key = strtoupper(str_replace('.', '', $branch)); return [ 'name' => $branch_key, - 'branch' => $branch, + 'ref' => $branch, ]; }, $branches); - return ['branches' => $result]; + return ['branch' => $result]; } $branches = get_branches(); diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 9a3425a75db56..bb0959ae48e16 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -65,20 +65,20 @@ jobs: # extended: ${{ inputs.extendedTests }} # runTestsParameters: ${{ inputs.runTestsParameters }} debug_zts_msan: - needs: generate_matrix - strategy: - matrix: ${{ fromJson(needs.generate_matrix.outputs.branch_matrix) }} - fail-fast: false - name: ${{ matrix.name }} + # needs: generate_matrix + # strategy: + # matrix: ${{ fromJson(needs.generate_matrix.outputs.branch_matrix) }} + # fail-fast: false + # name: ${{ matrix.branch.name }} runs-on: ubuntu-20.04 env: - arch: linux-x64 + ARCH: linux-x64 steps: - name: git checkout uses: actions/checkout@v2 # Only test on current branch until merged # with: - # ref: ${{ matrix.branch }} + # ref: ${{ matrix.branch.ref }} - name: Install dependencies uses: ./.github/actions/deps - name: ./configure @@ -91,7 +91,7 @@ jobs: # so we should avoiding linking against anything but libc here ./configure \ --enable-debug \ - --enable-zts + --enable-zts \ --enable-option-checking=fatal \ --prefix=/usr \ --without-sqlite3 \ @@ -143,20 +143,20 @@ jobs: extended: false runTestsParameters: '--msan' community: - needs: generate_matrix - strategy: - matrix: ${{ fromJson(needs.generate_matrix.outputs.branch_matrix) }} - fail-fast: false - name: ${{ matrix.name }} + # needs: generate_matrix + # strategy: + # matrix: ${{ fromJson(needs.generate_matrix.outputs.branch_matrix) }} + # fail-fast: false + # name: ${{ matrix.branch.name }} runs-on: ubuntu-20.04 env: - arch: linux-x64 + ARCH: linux-x64 steps: - name: git checkout uses: actions/checkout@v2 # Only test on current branch until merged # with: - # ref: ${{ matrix.branch }} + # ref: ${{ matrix.branch.ref }} - name: Install dependencies uses: ./.github/actions/deps - name: ./configure @@ -179,11 +179,6 @@ jobs: run: | sudo service mysql start mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" - - name: Test - uses: ./.github/actions/tests - with: - extended: false - runTestsParameters: '--msan' - name: Test Laravel run: | git clone https://github.com/laravel/framework.git --branch=master --depth=1 @@ -253,20 +248,20 @@ jobs: 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 coverage: - needs: generate_matrix - strategy: - matrix: ${{ fromJson(needs.generate_matrix.outputs.branch_matrix) }} - fail-fast: false - name: ${{ matrix.name }} + # needs: generate_matrix + # strategy: + # matrix: ${{ fromJson(needs.generate_matrix.outputs.branch_matrix) }} + # fail-fast: false + # name: ${{ matrix.branch.name }} runs-on: ubuntu-20.04 env: - arch: linux-x64 + ARCH: linux-x64 steps: - name: git checkout uses: actions/checkout@v2 # Only test on current branch until merged # with: - # ref: ${{ matrix.branch }} + # ref: ${{ matrix.branch.ref }} - name: Create mssql container uses: ./.github/actions/mssql - name: Install dependencies @@ -303,20 +298,20 @@ jobs: # codeCoverageTool: 'Cobertura' # summaryFileLocation: coverage.xml opcache_variation: - needs: generate_matrix - strategy: - matrix: ${{ fromJson(needs.generate_matrix.outputs.branch_matrix) }} - fail-fast: false - name: ${{ matrix.name }} + # needs: generate_matrix + # strategy: + # matrix: ${{ fromJson(needs.generate_matrix.outputs.branch_matrix) }} + # fail-fast: false + # name: ${{ matrix.branch.name }} runs-on: ubuntu-20.04 env: - arch: linux-x64 + ARCH: linux-x64 steps: - name: git checkout uses: actions/checkout@v2 # Only test on current branch until merged # with: - # ref: ${{ matrix.branch }} + # ref: ${{ matrix.branch.ref }} - name: Create mssql container uses: ./.github/actions/mssql - name: Install dependencies @@ -331,57 +326,53 @@ jobs: uses: ./.github/actions/install - name: Setup uses: ./.github/actions/setup - - name: Test + - name: Test File Cache (prime shm) uses: ./.github/actions/test with: runTestsParameters: -d zend_extension=opcache.so --file-cache-prime - - name: Test + - name: Test File Cache (prime shm, use shm) uses: ./.github/actions/test with: runTestsParameters: -d zend_extension=opcache.so --file-cache-use - - name: Test - uses: ./.github/actions/test - with: - runTestsParameters: -d zend_extension=opcache.so --file-cache-use - - name: Test + - name: Test File Cache (prime shm, use file) uses: ./.github/actions/test with: runTestsParameters: -d zend_extension=opcache.so --file-cache-use -d opcache.file_cache_only=1 - - name: Test + - name: Test File Cache (prime file) uses: ./.github/actions/test with: runTestsParameters: -d zend_extension=opcache.so --file-cache-prime -d opcache.file_cache_only=1 - - name: Test + - name: Test File Cache (prime file, use file) uses: ./.github/actions/test with: runTestsParameters: -d zend_extension=opcache.so --file-cache-use -d opcache.file_cache_only=1 - - name: Test + - name: Test File Cache (prime file, use shm) uses: ./.github/actions/test with: runTestsParameters: -d zend_extension=opcache.so --file-cache-use - - name: Test + - name: Test Without interned strings uses: ./.github/actions/test with: runTestsParameters: -d zend_extension=opcache.so -d opcache.interned_strings_buffer=0 - - name: Test + - name: Test Preload uses: ./.github/actions/test with: runTestsParameters: -d zend_extension=opcache.so --preload libmysqlclient_debug_nts: - needs: generate_matrix - strategy: - matrix: ${{ fromJson(needs.generate_matrix.outputs.branch_matrix) }} - fail-fast: false - name: ${{ matrix.name }} + # needs: generate_matrix + # strategy: + # matrix: ${{ fromJson(needs.generate_matrix.outputs.branch_matrix) }} + # fail-fast: false + # name: ${{ matrix.branch.name }} runs-on: ubuntu-20.04 env: - arch: linux-x64 + ARCH: linux-x64 steps: - name: git checkout uses: actions/checkout@v2 # Only test on current branch until merged # with: - # ref: ${{ matrix.branch }} + # ref: ${{ matrix.branch.ref }} - name: Install dependencies run: | sudo apt-get update -y | true @@ -398,13 +389,11 @@ jobs: # with: # configurationName: LIBMYSQLCLIENT_DEBUG_NTS - MySQL 5.6.49 # libmysql: mysql-5.6.49-linux-glibc2.12-x86_64.tar.gz - - uses: ./.github/actions/libmysql-test - with: - runTestsParameters: -d zend_extension=opcache.so --preload - uses: ./.github/actions/libmysql-test with: configurationName: LIBMYSQLCLIENT_DEBUG_NTS - MySQL 5.7.35 libmysql: mysql-5.7.35-linux-glibc2.12-x86_64.tar.gz + configurationParameters: --enable-debug --disable-zts - uses: ./.github/actions/libmysql-test with: configurationName: LIBMYSQLCLIENT_DEBUG_NTS - MySQL 8.0.27 From dd0e7479ed3ba8e74369097e52630221add90833 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Sat, 12 Feb 2022 11:48:04 +0100 Subject: [PATCH 7/7] wip --- .github/workflows/nightly.yml | 594 +++++++++++++++++----------------- 1 file changed, 296 insertions(+), 298 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index bb0959ae48e16..d49d6f13067d2 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -11,19 +11,19 @@ on: - CONTRIBUTING.md - CODING_STANDARDS.md jobs: - generate_matrix: - name: Generate Build Matrix - runs-on: ubuntu-latest - outputs: - test_matrix: ${{ steps.set-matrix.outputs.test_matrix }} - branch_matrix: ${{ steps.set-matrix.outputs.branch_matrix }} - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Generate Matrix - id: set_matrix - run: php .github/nightly_matrix.php + # generate_matrix: + # name: Generate Build Matrix + # runs-on: ubuntu-latest + # outputs: + # test_matrix: ${{ steps.set-matrix.outputs.test_matrix }} + # branch_matrix: ${{ steps.set-matrix.outputs.branch_matrix }} + # steps: + # - uses: actions/checkout@v2 + # with: + # fetch-depth: 0 + # - name: Generate Matrix + # id: set_matrix + # run: php .github/nightly_matrix.php # run_tests: # needs: generate_matrix # strategy: @@ -64,189 +64,187 @@ jobs: # with: # extended: ${{ inputs.extendedTests }} # runTestsParameters: ${{ inputs.runTestsParameters }} - debug_zts_msan: - # needs: generate_matrix - # strategy: - # matrix: ${{ fromJson(needs.generate_matrix.outputs.branch_matrix) }} - # fail-fast: false - # name: ${{ matrix.branch.name }} - runs-on: ubuntu-20.04 - env: - ARCH: linux-x64 - steps: - - name: git checkout - uses: actions/checkout@v2 - # Only test on current branch until merged - # with: - # ref: ${{ matrix.branch.ref }} - - name: Install dependencies - uses: ./.github/actions/deps - - name: ./configure - run: | - export CC=clang - export CXX=clang++ - export CFLAGS="-DZEND_TRACK_ARENA_ALLOC" - ./buildconf --force - # msan requires all used libraries to be instrumented, - # so we should avoiding linking against anything but libc here - ./configure \ - --enable-debug \ - --enable-zts \ - --enable-option-checking=fatal \ - --prefix=/usr \ - --without-sqlite3 \ - --without-pdo-sqlite \ - --without-libxml \ - --disable-dom \ - --disable-simplexml \ - --disable-xml \ - --disable-xmlreader \ - --disable-xmlwriter \ - --without-pcre-jit \ - --disable-opcache-jit \ - --enable-phpdbg \ - --enable-fpm \ - --with-pdo-mysql=mysqlnd \ - --with-mysqli=mysqlnd \ - --disable-mysqlnd-compression-support \ - --without-pear \ - --enable-exif \ - --enable-sysvsem \ - --enable-sysvshm \ - --enable-shmop \ - --enable-pcntl \ - --enable-mbstring \ - --disable-mbregex \ - --enable-sockets \ - --enable-bcmath \ - --enable-calendar \ - --enable-ftp \ - --enable-zend-test \ - --enable-werror \ - --enable-memory-sanitizer \ - --with-config-file-path=/etc \ - --with-config-file-scan-dir=/etc/php.d - - name: make - run: make -j$(/usr/bin/nproc) >/dev/null - - name: make install - uses: ./.github/actions/install - - name: Setup - uses: ./.github/actions/setup - - name: mysql - # FIXME: Can we reuse the setup action? - run: | - sudo service mysql start - mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" - - name: Test - uses: ./.github/actions/tests - with: - extended: false - runTestsParameters: '--msan' - community: - # needs: generate_matrix - # strategy: - # matrix: ${{ fromJson(needs.generate_matrix.outputs.branch_matrix) }} - # fail-fast: false - # name: ${{ matrix.branch.name }} - runs-on: ubuntu-20.04 - env: - ARCH: linux-x64 - steps: - - name: git checkout - uses: actions/checkout@v2 - # Only test on current branch until merged - # with: - # ref: ${{ matrix.branch.ref }} - - name: Install dependencies - uses: ./.github/actions/deps - - name: ./configure - uses: ./.github/actions/configure - with: - configurationParameters: >- - --enable-debug --enable-zts --enable-address-sanitizer --enable-undefined-sanitizer - CFLAGS="-fno-sanitize-recover" - - name: make - run: make -j$(/usr/bin/nproc) >/dev/null - - name: make install - uses: ./.github/actions/install - - name: Enable OpCache and JIT - run: | - # Run with opcache to also catch optimizer bugs. - echo zend_extension=opcache.so > /etc/php.d/opcache.ini - echo opcache.jit_buffer_size=1G >> /etc/php.d/opcache.ini - - name: mysql - # FIXME: Can we reuse the setup action? - run: | - sudo service mysql start - mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" - - name: Test Laravel - run: | - 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 - - name: Test Symfony - if: always() - run: | - 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 - - name: Test Amphp - if: always() - run: | - 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 - - name: Test PHPUnit - if: always() - run: | - 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 - - name: Symfony Preloading - if: always() - run: | - 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 + # debug_zts_msan: + # # needs: generate_matrix + # # strategy: + # # matrix: ${{ fromJson(needs.generate_matrix.outputs.branch_matrix) }} + # # fail-fast: false + # # name: ${{ matrix.branch.name }} + # runs-on: ubuntu-20.04 + # env: + # ARCH: linux-x64 + # steps: + # - name: git checkout + # uses: actions/checkout@v2 + # # Only test on current branch until merged + # # with: + # # ref: ${{ matrix.branch.ref }} + # - name: Install dependencies + # uses: ./.github/actions/deps + # - name: ./configure + # run: | + # export CC=clang + # export CXX=clang++ + # export CFLAGS="-DZEND_TRACK_ARENA_ALLOC" + # ./buildconf --force + # # msan requires all used libraries to be instrumented, + # # so we should avoiding linking against anything but libc here + # ./configure \ + # --enable-debug \ + # --enable-zts \ + # --enable-option-checking=fatal \ + # --prefix=/usr \ + # --without-sqlite3 \ + # --without-pdo-sqlite \ + # --without-libxml \ + # --disable-dom \ + # --disable-simplexml \ + # --disable-xml \ + # --disable-xmlreader \ + # --disable-xmlwriter \ + # --without-pcre-jit \ + # --disable-opcache-jit \ + # --enable-phpdbg \ + # --enable-fpm \ + # --with-pdo-mysql=mysqlnd \ + # --with-mysqli=mysqlnd \ + # --disable-mysqlnd-compression-support \ + # --without-pear \ + # --enable-exif \ + # --enable-sysvsem \ + # --enable-sysvshm \ + # --enable-shmop \ + # --enable-pcntl \ + # --enable-mbstring \ + # --disable-mbregex \ + # --enable-sockets \ + # --enable-bcmath \ + # --enable-calendar \ + # --enable-ftp \ + # --enable-zend-test \ + # --enable-werror \ + # --enable-memory-sanitizer \ + # --with-config-file-path=/etc \ + # --with-config-file-scan-dir=/etc/php.d + # - name: make + # run: make -j$(/usr/bin/nproc) >/dev/null + # - name: make install + # uses: ./.github/actions/install + # - name: Setup + # # FIXME: Can we reuse the setup action? + # run: | + # sudo service mysql start + # mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" + # - name: Test + # uses: ./.github/actions/tests + # with: + # extended: false + # runTestsParameters: '--msan' + # community: + # # needs: generate_matrix + # # strategy: + # # matrix: ${{ fromJson(needs.generate_matrix.outputs.branch_matrix) }} + # # fail-fast: false + # # name: ${{ matrix.branch.name }} + # runs-on: ubuntu-20.04 + # env: + # ARCH: linux-x64 + # steps: + # - name: git checkout + # uses: actions/checkout@v2 + # # Only test on current branch until merged + # # with: + # # ref: ${{ matrix.branch.ref }} + # - name: Install dependencies + # uses: ./.github/actions/deps + # - name: ./configure + # uses: ./.github/actions/configure + # with: + # configurationParameters: >- + # --enable-debug --enable-zts --enable-address-sanitizer --enable-undefined-sanitizer + # CFLAGS="-fno-sanitize-recover" + # - name: make + # run: make -j$(/usr/bin/nproc) >/dev/null + # - name: make install + # uses: ./.github/actions/install + # - name: Enable OpCache and JIT + # run: | + # # Run with opcache to also catch optimizer bugs. + # echo zend_extension=opcache.so > /etc/php.d/opcache.ini + # echo opcache.jit_buffer_size=1G >> /etc/php.d/opcache.ini + # - name: mysql + # # FIXME: Can we reuse the setup action? + # run: | + # sudo service mysql start + # mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" + # - name: Test Laravel + # run: | + # 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 + # - name: Test Symfony + # if: always() + # run: | + # 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 + # - name: Test Amphp + # if: always() + # run: | + # 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 + # - name: Test PHPUnit + # if: always() + # run: | + # 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 + # - name: Symfony Preloading + # if: always() + # run: | + # 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 coverage: # needs: generate_matrix # strategy: @@ -297,105 +295,105 @@ jobs: # inputs: # codeCoverageTool: 'Cobertura' # summaryFileLocation: coverage.xml - opcache_variation: - # needs: generate_matrix - # strategy: - # matrix: ${{ fromJson(needs.generate_matrix.outputs.branch_matrix) }} - # fail-fast: false - # name: ${{ matrix.branch.name }} - runs-on: ubuntu-20.04 - env: - ARCH: linux-x64 - steps: - - name: git checkout - uses: actions/checkout@v2 - # Only test on current branch until merged - # with: - # ref: ${{ matrix.branch.ref }} - - name: Create mssql container - uses: ./.github/actions/mssql - - name: Install dependencies - uses: ./.github/actions/deps - - name: ./configure - uses: ./.github/actions/configure - with: - configurationParameters: --enable-debug --disable-zts - - name: make - run: make -j$(/usr/bin/nproc) >/dev/null - - name: make install - uses: ./.github/actions/install - - name: Setup - uses: ./.github/actions/setup - - name: Test File Cache (prime shm) - uses: ./.github/actions/test - with: - runTestsParameters: -d zend_extension=opcache.so --file-cache-prime - - name: Test File Cache (prime shm, use shm) - uses: ./.github/actions/test - with: - runTestsParameters: -d zend_extension=opcache.so --file-cache-use - - name: Test File Cache (prime shm, use file) - uses: ./.github/actions/test - with: - runTestsParameters: -d zend_extension=opcache.so --file-cache-use -d opcache.file_cache_only=1 - - name: Test File Cache (prime file) - uses: ./.github/actions/test - with: - runTestsParameters: -d zend_extension=opcache.so --file-cache-prime -d opcache.file_cache_only=1 - - name: Test File Cache (prime file, use file) - uses: ./.github/actions/test - with: - runTestsParameters: -d zend_extension=opcache.so --file-cache-use -d opcache.file_cache_only=1 - - name: Test File Cache (prime file, use shm) - uses: ./.github/actions/test - with: - runTestsParameters: -d zend_extension=opcache.so --file-cache-use - - name: Test Without interned strings - uses: ./.github/actions/test - with: - runTestsParameters: -d zend_extension=opcache.so -d opcache.interned_strings_buffer=0 - - name: Test Preload - uses: ./.github/actions/test - with: - runTestsParameters: -d zend_extension=opcache.so --preload - libmysqlclient_debug_nts: - # needs: generate_matrix - # strategy: - # matrix: ${{ fromJson(needs.generate_matrix.outputs.branch_matrix) }} - # fail-fast: false - # name: ${{ matrix.branch.name }} - runs-on: ubuntu-20.04 - env: - ARCH: linux-x64 - steps: - - name: git checkout - uses: actions/checkout@v2 - # Only test on current branch until merged - # with: - # ref: ${{ matrix.branch.ref }} - - name: Install dependencies - run: | - sudo apt-get update -y | true - sudo apt install bison re2c - - name: Setup MySQL server - run: | - set -o - sudo service mysql start - mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" - # Ensure local_infile tests can run. - mysql -uroot -proot -e "SET GLOBAL local_infile = true" - # Does not support caching_sha2_auth :( - # - uses: ./.github/actions/libmysql-test - # with: - # configurationName: LIBMYSQLCLIENT_DEBUG_NTS - MySQL 5.6.49 - # libmysql: mysql-5.6.49-linux-glibc2.12-x86_64.tar.gz - - uses: ./.github/actions/libmysql-test - with: - configurationName: LIBMYSQLCLIENT_DEBUG_NTS - MySQL 5.7.35 - libmysql: mysql-5.7.35-linux-glibc2.12-x86_64.tar.gz - configurationParameters: --enable-debug --disable-zts - - uses: ./.github/actions/libmysql-test - with: - configurationName: LIBMYSQLCLIENT_DEBUG_NTS - MySQL 8.0.27 - libmysql: mysql-8.0.27-linux-glibc2.12-x86_64.tar.xz - configurationParameters: --enable-debug --disable-zts --enable-werror + # opcache_variation: + # # needs: generate_matrix + # # strategy: + # # matrix: ${{ fromJson(needs.generate_matrix.outputs.branch_matrix) }} + # # fail-fast: false + # # name: ${{ matrix.branch.name }} + # runs-on: ubuntu-20.04 + # env: + # ARCH: linux-x64 + # steps: + # - name: git checkout + # uses: actions/checkout@v2 + # # Only test on current branch until merged + # # with: + # # ref: ${{ matrix.branch.ref }} + # - name: Create mssql container + # uses: ./.github/actions/mssql + # - name: Install dependencies + # uses: ./.github/actions/deps + # - name: ./configure + # uses: ./.github/actions/configure + # with: + # configurationParameters: --enable-debug --disable-zts + # - name: make + # run: make -j$(/usr/bin/nproc) >/dev/null + # - name: make install + # uses: ./.github/actions/install + # - name: Setup + # uses: ./.github/actions/setup + # - name: Test File Cache (prime shm) + # uses: ./.github/actions/test + # with: + # runTestsParameters: -d zend_extension=opcache.so --file-cache-prime + # - name: Test File Cache (prime shm, use shm) + # uses: ./.github/actions/test + # with: + # runTestsParameters: -d zend_extension=opcache.so --file-cache-use + # - name: Test File Cache (prime shm, use file) + # uses: ./.github/actions/test + # with: + # runTestsParameters: -d zend_extension=opcache.so --file-cache-use -d opcache.file_cache_only=1 + # - name: Test File Cache (prime file) + # uses: ./.github/actions/test + # with: + # runTestsParameters: -d zend_extension=opcache.so --file-cache-prime -d opcache.file_cache_only=1 + # - name: Test File Cache (prime file, use file) + # uses: ./.github/actions/test + # with: + # runTestsParameters: -d zend_extension=opcache.so --file-cache-use -d opcache.file_cache_only=1 + # - name: Test File Cache (prime file, use shm) + # uses: ./.github/actions/test + # with: + # runTestsParameters: -d zend_extension=opcache.so --file-cache-use + # - name: Test Without interned strings + # uses: ./.github/actions/test + # with: + # runTestsParameters: -d zend_extension=opcache.so -d opcache.interned_strings_buffer=0 + # - name: Test Preload + # uses: ./.github/actions/test + # with: + # runTestsParameters: -d zend_extension=opcache.so --preload + # libmysqlclient_debug_nts: + # # needs: generate_matrix + # # strategy: + # # matrix: ${{ fromJson(needs.generate_matrix.outputs.branch_matrix) }} + # # fail-fast: false + # # name: ${{ matrix.branch.name }} + # runs-on: ubuntu-20.04 + # env: + # ARCH: linux-x64 + # steps: + # - name: git checkout + # uses: actions/checkout@v2 + # # Only test on current branch until merged + # # with: + # # ref: ${{ matrix.branch.ref }} + # - name: Install dependencies + # run: | + # sudo apt-get update -y | true + # sudo apt install bison re2c + # - name: Setup MySQL server + # run: | + # set -o + # sudo service mysql start + # mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" + # # Ensure local_infile tests can run. + # mysql -uroot -proot -e "SET GLOBAL local_infile = true" + # # Does not support caching_sha2_auth :( + # # - uses: ./.github/actions/libmysql-test + # # with: + # # configurationName: LIBMYSQLCLIENT_DEBUG_NTS - MySQL 5.6.49 + # # libmysql: mysql-5.6.49-linux-glibc2.12-x86_64.tar.gz + # - uses: ./.github/actions/libmysql-test + # with: + # configurationName: LIBMYSQLCLIENT_DEBUG_NTS - MySQL 5.7.35 + # libmysql: mysql-5.7.35-linux-glibc2.12-x86_64.tar.gz + # configurationParameters: --enable-debug --disable-zts + # - uses: ./.github/actions/libmysql-test + # with: + # configurationName: LIBMYSQLCLIENT_DEBUG_NTS - MySQL 8.0.27 + # libmysql: mysql-8.0.27-linux-glibc2.12-x86_64.tar.xz + # configurationParameters: --enable-debug --disable-zts --enable-werror