From 8a887a1cb1ada263bf42f8dd6424fd821871a663 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Thu, 5 Feb 2026 16:13:50 +0100 Subject: [PATCH 01/11] Unify push & nightly workflows Also introduce label-based opt-in and opt-out mechanism for jobs. --- .github/nightly_matrix.php | 109 +++++++++++++ .github/workflows/nightly.yml | 222 +++++++++----------------- .github/workflows/push.yml | 286 +++------------------------------- .github/workflows/root.yml | 22 +-- 4 files changed, 204 insertions(+), 435 deletions(-) diff --git a/.github/nightly_matrix.php b/.github/nightly_matrix.php index 0032da7dbcea8..18ad6c008b59f 100644 --- a/.github/nightly_matrix.php +++ b/.github/nightly_matrix.php @@ -46,6 +46,104 @@ function get_current_version(): array { return [$major, $minor]; } +function select_jobs($trigger, $labels, $php_version, $ref, $comprehensive) { + $disable_all = in_array('CI: Disable all', $labels, true); + $enable_all = in_array('CI: Enable all', $labels, true); + $test_alpine = in_array('CI: Alpine', $labels, true); + $test_benchmarking = in_array('CI: Benchmarking', $labels, true); + $test_community = in_array('CI: Community', $labels, true); + $test_freebsd = in_array('CI: FreeBSD', $labels, true); + $test_libmysqlclient = in_array('CI: libmysqlclient', $labels, true); + $test_linux_ppc64 = in_array('CI: Linux PPC64', $labels, true); + $test_linux_x32 = in_array('CI: Linux X32', $labels, true); + $test_linux_x64 = in_array('CI: Linux X64', $labels, true); + $test_macos = in_array('CI: macOS', $labels, true); + $test_msan = in_array('CI: MSAN', $labels, true); + $test_opcache_variation = in_array('CI: Opcache Variation', $labels, true); + $test_windows = in_array('CI: Windows', $labels, true); + + $jobs = []; + if (version_compare($php_version, '8.4', '>=') && ($enable_all || !$disable_all || $test_alpine)) { + $jobs['ALPINE'] = true; + } + if ($enable_all || $test_community) { + $jobs['COMMUNITY']['matrix'] = version_compare($php_version, '8.4', '>=') + ? ['type' => ['asan', 'verify_type_inference']] + : ['type' => ['asan']]; + $jobs['COMMUNITY']['config']['symfony_version'] = version_compare($php_version, '8.4', '>=') ? '8.1' : '7.4'; + } + if ($trigger === 'schedule' && $ref === 'master') { + $jobs['COVERAGE'] = true; + } + if ($enable_all || $test_libmysqlclient) { + $jobs['LIBMYSQLCLIENT'] = true; + } + if (version_compare($php_version, '8.4', '>=') && ($enable_all || $test_linux_ppc64)) { + $jobs['LINUX_PPC64'] = true; + } + if ($enable_all || !$disable_all || $test_linux_x64) { + $jobs['LINUX_X64']['matrix'] = $comprehensive + ? [ + 'name' => [''], + 'asan' => [false], + 'debug' => [true, false], + 'repeat' => [false], + 'variation' => [false], + 'zts' => [true, false], + 'include' => [ + ['name' => '_ASAN', 'asan' => true, 'debug' => true, 'repeat' => false, 'variation' => false, 'zts' => true], + ['name' => '_REPEAT', 'asan' => false, 'debug' => true, 'repeat' => true, 'variation' => false, 'zts' => false], + ['name' => '_VARIATION', 'asan' => false, 'debug' => true, 'repeat' => false, 'variation' => true, 'zts' => true], + ], + ] + : ['include' => [ + ['name' => '', 'asan' => false, 'debug' => false, 'repeat' => false, 'variation' => false, 'zts' => false], + ['name' => '_ASAN', 'asan' => true, 'debug' => true, 'repeat' => false, 'variation' => false, 'zts' => true], + ]]; + $jobs['LINUX_X64']['config']['variation_enable_zend_max_execution_timers'] = version_compare($php_version, '8.3', '>='); + } + if ($enable_all || !$disable_all || $test_linux_x32) { + $jobs['LINUX_X32']['matrix'] = $comprehensive + ? ['debug' => [true, false], 'zts' => [true, false]] + : ['debug' => [true], 'zts' => [true]]; + } + if ($enable_all || !$disable_all || $test_macos) { + $test_arm = version_compare($php_version, '8.4', '>='); + $jobs['MACOS']['matrix'] = $comprehensive + ? ['arch' => $test_arm ? ['X64', 'ARM64'] : ['X64'], 'debug' => [true, false], 'zts' => [true, false]] + : ['include' => [['arch' => $test_arm ? 'ARM64' : 'X64', 'debug' => true, 'zts' => false]]]; + $jobs['MACOS']['config']['arm64_version'] = version_compare($php_version, '8.4', '>=') ? '15' : '14'; + } + if ($enable_all || $test_msan) { + $jobs['MSAN'] = true; + } + if ($enable_all || $test_opcache_variation) { + $jobs['OPCACHE_VARIATION'] = true; + } + if ($trigger === 'schedule' && $ref === 'master') { + $jobs['PECL'] = true; + } + if ($enable_all || !$disable_all || $test_windows) { + $windows_jobs = ['include' => [['asan' => true, 'opcache' => true, 'x64' => true, 'zts' => true]]]; + if ($comprehensive) { + $windows_jobs['include'][] = ['asan' => false, 'opcache' => false, 'x64' => false, 'zts' => false]; + } + $jobs['WINDOWS']['matrix'] = $windows_jobs; + $jobs['WINDOWS']['config'] = version_compare($php_version, '8.4', '>=') + ? ['vs_crt_version' => 'vs17'] + : ['vs_crt_version' => 'vs16']; + } + if ($enable_all || !$disable_all || $test_benchmarking) { + $jobs['BENCHMARKING'] = true; + } + if ($enable_all || !$disable_all || $test_freebsd) { + $jobs['FREEBSD']['matrix'] = $comprehensive && version_compare($php_version, '8.3', '>=') + ? ['zts' => [true, false]] + : ['zts' => [false]]; + } + return $jobs; +} + $trigger = $argv[1] ?? 'schedule'; $attempt = (int) ($argv[2] ?? 1); $sunday = date('w', time()) === '0'; @@ -60,6 +158,17 @@ function get_current_version(): array { ? get_branches() : [['ref' => $branch, 'version' => get_current_version()]]; +$labels = json_decode($argv[4] ?? '[]', true); +$labels = array_column($labels, 'name'); +$comprehensive = $trigger === 'schedule' || $trigger === 'workflow_dispatch' || in_array('CI: Comprehensive', $labels, true); + +foreach ($branches as &$branch) { + $php_version = $branch['version'][0] . '.' . $branch['version'][1]; + $branch['jobs'] = select_jobs($trigger, $labels, $php_version, $branch['ref'], $comprehensive); + $branch['config']['ubuntu_version'] = version_compare($php_version, '8.5', '>=') ? '24.04' : '22.04'; +} + $f = fopen(getenv('GITHUB_OUTPUT'), 'a'); fwrite($f, 'branches=' . json_encode($branches, JSON_UNESCAPED_SLASHES) . "\n"); +fwrite($f, 'comprehensive=' . json_encode($comprehensive, JSON_UNESCAPED_SLASHES) . "\n"); fclose($f); diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 97064ad3972d0..d1ea884777240 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -2,64 +2,25 @@ name: Test suite on: workflow_call: inputs: - asan_ubuntu_version: - required: true - type: string branch: required: true type: string - community_verify_type_inference: - required: true - type: boolean - macos_arm64_version: - required: true - type: string - run_alpine: - required: true - type: boolean - run_linux_ppc64: - required: true - type: boolean - run_macos_arm64: - required: true - type: boolean - run_freebsd_zts: - required: true - type: boolean - ubuntu_version: - required: true - type: string - windows_version: - required: true - type: string - vs_crt_version: - required: true - type: string - skip_laravel: - required: true - type: boolean - symfony_version: - required: true - type: string - skip_wordpress: - required: true - type: boolean - variation_enable_zend_max_execution_timers: + comprehensive: required: true type: boolean permissions: contents: read jobs: LINUX_PPC64: - if: inputs.run_linux_ppc64 - name: LINUX_PPC64_ASAN_UBSAN_DEBUG_ZTS + if: fromJson(inputs.branch).jobs.LINUX_PPC64 + name: LINUX_PPC64_ASAN_DEBUG_ZTS # This runs on a self-hosted runner; see https://wiki.php.net/systems/ci runs-on: [self-hosted, gentoo, ppc64] steps: - name: git checkout uses: actions/checkout@v6 with: - ref: ${{ inputs.branch }} + ref: ${{ fromJson(inputs.branch).ref }} - name: System info run: | echo "::group::Show host CPU info" @@ -91,8 +52,8 @@ jobs: - name: Extra tests uses: ./.github/actions/extra-tests ALPINE: - if: inputs.run_alpine - name: ALPINE_X64_ASAN_UBSAN_DEBUG_ZTS + if: fromJson(inputs.branch).jobs.ALPINE + name: ALPINE_X64_ASAN_DEBUG_ZTS runs-on: ubuntu-24.04 container: image: 'alpine:3.22' @@ -100,7 +61,7 @@ jobs: - name: git checkout uses: actions/checkout@v6 with: - ref: ${{ inputs.branch }} + ref: ${{ fromJson(inputs.branch).ref }} - name: apk uses: ./.github/actions/apk - name: System info @@ -136,6 +97,7 @@ jobs: - name: Extra tests uses: ./.github/actions/extra-tests LINUX_X64: + if: fromJson(inputs.branch).jobs.LINUX_X64 services: mysql: image: mysql:8.4 @@ -161,47 +123,14 @@ jobs: FIREBIRD_PASSWORD: test strategy: fail-fast: false - matrix: - configuration_parameters: [''] - debug: [true, false] - name: [''] - run_tests_parameters: [''] - test_function_jit: [true] - zts: [true, false] - include: - - name: _ASAN_UBSAN - debug: true - zts: true - configuration_parameters: >- - CFLAGS="-fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC" - LDFLAGS="-fsanitize=undefined,address" - run_tests_parameters: '--asan' - test_function_jit: false - asan: true - - name: _REPEAT - debug: true - zts: false - run_tests_parameters: --repeat 2 - timeout_minutes: 360 - test_function_jit: true - asan: false - - name: _VARIATION - debug: true - zts: true - configuration_parameters: >- - CFLAGS="-DZEND_RC_DEBUG=1 -DPROFITABILITY_CHECKS=0 -DZEND_VERIFY_FUNC_INFO=1 -DZEND_VERIFY_TYPE_INFERENCE" - ${{ inputs.variation_enable_zend_max_execution_timers && '--enable-zend-max-execution-timers' || '' }} - run_tests_parameters: -d zend_test.observer.enabled=1 -d zend_test.observer.show_output=0 - timeout_minutes: 360 - test_function_jit: true - asan: false + matrix: ${{ fromJson(inputs.branch).jobs.LINUX_X64.matrix }} name: "LINUX_X64${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" - runs-on: ubuntu-${{ matrix.asan && inputs.asan_ubuntu_version || inputs.ubuntu_version }} + runs-on: ubuntu-${{ fromJson(inputs.branch).config.ubuntu_version }} steps: - name: git checkout uses: actions/checkout@v6 with: - ref: ${{ inputs.branch }} + ref: ${{ fromJson(inputs.branch).ref }} - name: Create MSSQL container uses: ./.github/actions/setup-mssql - name: apt @@ -220,10 +149,13 @@ jobs: uses: ./.github/actions/configure-x64 with: configurationParameters: >- - ${{ matrix.configuration_parameters }} + ${{ matrix.asan && 'CFLAGS="-fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address"' || '' }} + ${{ matrix.variation && 'CFLAGS="-DZEND_RC_DEBUG=1 -DPROFITABILITY_CHECKS=0 -DZEND_VERIFY_FUNC_INFO=1 -DZEND_VERIFY_TYPE_INFERENCE"' || '' }} + ${{ (matrix.variation && fromJson(inputs.branch).jobs.LINUX_X64.config.variation_enable_zend_max_execution_timers) && '--enable-zend-max-execution-timers' || '' }} --${{ matrix.debug && 'enable' || 'disable' }}-debug --${{ matrix.zts && 'enable' || 'disable' }}-zts asan: ${{ matrix.asan && 'true' || 'false' }} + skipSlow: ${{ (matrix.asan && !matrix.comprehensive) && 'true' || 'false' }} - name: make run: make -j$(/usr/bin/nproc) >/dev/null - name: make install @@ -231,48 +163,56 @@ jobs: - name: Setup uses: ./.github/actions/setup-x64 - name: Test + if: ${{ inputs.comprehensive || !matrix.asan }} uses: ./.github/actions/test-linux with: runTestsParameters: >- - ${{ matrix.run_tests_parameters }} + ${{ matrix.asan && '--asan' || '' }} + ${{ matrix.repeat && '--repeat 2' || '' }} + ${{ matrix.variation && '-d zend_test.observer.enabled=1 -d zend_test.observer.show_output=0' || '' }} idleCpu: ${{ matrix.asan && 'true' || 'false' }} - name: Test Tracing JIT uses: ./.github/actions/test-linux with: jitType: tracing runTestsParameters: >- - ${{ matrix.run_tests_parameters }} + ${{ matrix.asan && '--asan' || '' }} + ${{ matrix.repeat && '--repeat 2' || '' }} + ${{ matrix.variation && '-d zend_test.observer.enabled=1 -d zend_test.observer.show_output=0' || '' }} -d opcache.enable_cli=1 - name: Test OpCache + if: ${{ inputs.comprehensive }} uses: ./.github/actions/test-linux with: runTestsParameters: >- - ${{ matrix.run_tests_parameters }} + ${{ matrix.asan && '--asan' || '' }} + ${{ matrix.repeat && '--repeat 2' || '' }} + ${{ matrix.variation && '-d zend_test.observer.enabled=1 -d zend_test.observer.show_output=0' || '' }} -d opcache.enable_cli=1 - name: Test Function JIT # ASAN frequently timeouts. Each test run takes ~90 minutes, we can # avoid running into the 6 hour timeout by skipping the function JIT. - if: matrix.test_function_jit + if: ${{ inputs.comprehensive && !matrix.asan }} uses: ./.github/actions/test-linux with: jitType: function runTestsParameters: >- - ${{ matrix.run_tests_parameters }} + ${{ matrix.repeat && '--repeat 2' || '' }} + ${{ matrix.variation && '-d zend_test.observer.enabled=1 -d zend_test.observer.show_output=0' || '' }} -d opcache.enable_cli=1 - name: Extra tests uses: ./.github/actions/extra-tests - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files LINUX_X32: + if: fromJson(inputs.branch).jobs.LINUX_X32 strategy: fail-fast: false - matrix: - debug: [true, false] - zts: [true, false] + matrix: ${{ fromJson(inputs.branch).jobs.LINUX_X32.matrix }} name: "LINUX_X32_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" runs-on: ubuntu-latest container: - image: ubuntu:${{ inputs.ubuntu_version }} + image: ubuntu:${{ fromJson(inputs.branch).config.ubuntu_version }} env: PDO_FIREBIRD_TEST_DSN: firebird:dbname=firebird:test.fdb services: @@ -296,7 +236,7 @@ jobs: - name: git checkout uses: actions/checkout@v6 with: - ref: ${{ inputs.branch }} + ref: ${{ fromJson(inputs.branch).ref }} - name: apt uses: ./.github/actions/apt-x32 - name: System info @@ -318,6 +258,7 @@ jobs: - name: make install uses: ./.github/actions/install-linux-x32 - name: Test + if: ${{ inputs.comprehensive }} uses: ./.github/actions/test-linux with: runTestsParameters: >- @@ -330,12 +271,14 @@ jobs: ${{ matrix.run_tests_parameters }} -d opcache.enable_cli=1 - name: Test OpCache + if: ${{ inputs.comprehensive }} uses: ./.github/actions/test-linux with: runTestsParameters: >- ${{ matrix.run_tests_parameters }} -d opcache.enable_cli=1 - name: Test Function JIT + if: ${{ inputs.comprehensive }} uses: ./.github/actions/test-linux with: jitType: function @@ -345,21 +288,17 @@ jobs: - name: Extra tests uses: ./.github/actions/extra-tests MACOS: + if: fromJson(inputs.branch).jobs.MACOS strategy: fail-fast: false - matrix: - debug: [true, false] - zts: [true, false] - arch: ['X64', 'ARM64'] - exclude: - - arch: ${{ !inputs.run_macos_arm64 && 'ARM64' || '*never*' }} + matrix: ${{ fromJson(inputs.branch).jobs.MACOS.matrix }} name: "MACOS_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" - runs-on: macos-${{ matrix.arch == 'X64' && '15-intel' || inputs.macos_arm64_version }} + runs-on: macos-${{ matrix.arch == 'X64' && '15-intel' || fromJson(inputs.branch).jobs.MACOS.config.arm64_version }} steps: - name: git checkout uses: actions/checkout@v6 with: - ref: ${{ inputs.branch }} + ref: ${{ fromJson(inputs.branch).ref }} - name: Update clang uses: ./.github/actions/macos-update-clang - name: brew @@ -378,6 +317,7 @@ jobs: - name: make install run: sudo make install - name: Test + if: ${{ inputs.comprehensive }} uses: ./.github/actions/test-macos - name: Test Tracing JIT if: matrix.arch == 'X64' || !matrix.zts @@ -387,12 +327,13 @@ jobs: runTestsParameters: >- -d opcache.enable_cli=1 - name: Test OpCache + if: ${{ inputs.comprehensive }} uses: ./.github/actions/test-macos with: runTestsParameters: >- -d opcache.enable_cli=1 - name: Test Function JIT - if: matrix.arch == 'X64' || !matrix.zts + if: inputs.comprehensive && (matrix.arch == 'X64' || !matrix.zts) uses: ./.github/actions/test-macos with: jitType: function @@ -402,8 +343,8 @@ jobs: uses: ./.github/actions/extra-tests - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files - COVERAGE_DEBUG_NTS: - if: inputs.branch == 'master' + COVERAGE: + if: fromJson(inputs.branch).jobs.COVERAGE services: mysql: image: mysql:8.4 @@ -432,7 +373,7 @@ jobs: - name: git checkout uses: actions/checkout@v6 with: - ref: ${{ inputs.branch }} + ref: ${{ fromJson(inputs.branch).ref }} - name: Create MSSQL container uses: ./.github/actions/setup-mssql - name: apt @@ -463,14 +404,12 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} verbose: true COMMUNITY: + if: fromJson(inputs.branch).jobs.COMMUNITY strategy: fail-fast: false - matrix: - type: ['asan', 'verify_type_inference'] - exclude: - - type: ${{ !inputs.community_verify_type_inference && 'verify_type_inference' || '*never*' }} + matrix: ${{ fromJson(inputs.branch).jobs.COMMUNITY.matrix }} name: "COMMUNITY_${{ matrix.type }}" - runs-on: ubuntu-${{ inputs.ubuntu_version }} + runs-on: ubuntu-${{ fromJson(inputs.branch).config.ubuntu_version }} env: ASAN_OPTIONS: exitcode=139 UBSAN_OPTIONS: print_stacktrace=1 @@ -480,7 +419,7 @@ jobs: - name: git checkout uses: actions/checkout@v6 with: - ref: ${{ inputs.branch }} + ref: ${{ fromJson(inputs.branch).ref }} - name: apt uses: ./.github/actions/apt-x64 - name: ./configure @@ -545,7 +484,7 @@ jobs: done exit $X - name: Test Laravel - if: ${{ !cancelled() && !inputs.skip_laravel }} + if: ${{ !cancelled() }} run: | git clone https://github.com/laravel/framework.git --depth=1 cd framework @@ -590,9 +529,9 @@ jobs: exit 1 fi - name: Test Symfony - if: ${{ !cancelled() && inputs.symfony_version != '' }} + if: ${{ !cancelled() }} run: | - git clone https://github.com/symfony/symfony.git --depth=1 --branch="${{ inputs.symfony_version }}" + git clone https://github.com/symfony/symfony.git --depth=1 --branch="${{ fromJson(inputs.branch).jobs.COMMUNITY.config.symfony_version }}" cd symfony git rev-parse HEAD php /usr/bin/composer install --no-progress --ignore-platform-req=php+ @@ -627,7 +566,7 @@ jobs: fi - name: 'Symfony Preloading' # composer create-project will automatically pick the right Symfony version for us. - if: ${{ !cancelled() && inputs.symfony_version != '' }} + if: ${{ !cancelled() }} run: | php /usr/bin/composer create-project symfony/symfony-demo symfony_demo --no-progress --ignore-platform-req=php+ cd symfony_demo @@ -635,7 +574,7 @@ 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 - name: Test Wordpress - if: ${{ !cancelled() && !inputs.skip_wordpress }} + if: ${{ !cancelled() }} run: | git clone https://github.com/WordPress/wordpress-develop.git wordpress --depth=1 cd wordpress @@ -650,6 +589,7 @@ jobs: exit 1 fi OPCACHE_VARIATION: + if: fromJson(inputs.branch).jobs.OPCACHE_VARIATION services: mysql: image: mysql:8.4 @@ -674,12 +614,12 @@ jobs: FIREBIRD_USER: test FIREBIRD_PASSWORD: test name: OPCACHE_VARIATION - runs-on: ubuntu-${{ inputs.ubuntu_version }} + runs-on: ubuntu-${{ fromJson(inputs.branch).config.ubuntu_version }} steps: - name: git checkout uses: actions/checkout@v6 with: - ref: ${{ inputs.branch }} + ref: ${{ fromJson(inputs.branch).ref }} - name: Create MSSQL container uses: ./.github/actions/setup-mssql - name: apt @@ -731,13 +671,14 @@ jobs: - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files MSAN: + if: fromJson(inputs.branch).jobs.MSAN name: MSAN - runs-on: ubuntu-${{ inputs.ubuntu_version }} + runs-on: ubuntu-${{ fromJson(inputs.branch).config.ubuntu_version }} steps: - name: git checkout uses: actions/checkout@v6 with: - ref: ${{ inputs.branch }} + ref: ${{ fromJson(inputs.branch).ref }} - name: apt uses: ./.github/actions/apt-x64 - name: ./configure @@ -817,13 +758,14 @@ jobs: - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files LIBMYSQLCLIENT: + if: fromJson(inputs.branch).jobs.LIBMYSQLCLIENT name: LIBMYSQLCLIENT - runs-on: ubuntu-${{ inputs.ubuntu_version }} + runs-on: ubuntu-${{ fromJson(inputs.branch).config.ubuntu_version }} steps: - name: git checkout uses: actions/checkout@v6 with: - ref: ${{ inputs.branch }} + ref: ${{ fromJson(inputs.branch).ref }} - name: apt run: | sudo apt-get update -y | true @@ -851,7 +793,7 @@ jobs: - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files PECL: - if: inputs.branch == 'master' + if: fromJson(inputs.branch).jobs.PECL runs-on: ubuntu-24.04 env: CC: ccache gcc @@ -861,7 +803,7 @@ jobs: uses: actions/checkout@v6 with: path: php - ref: ${{ inputs.branch }} + ref: ${{ fromJson(inputs.branch).ref }} - name: git checkout apcu uses: actions/checkout@v6 with: @@ -960,32 +902,18 @@ jobs: ./configure --prefix=/opt/php --with-php-config=/opt/php/bin/php-config make -j$(/usr/bin/nproc) WINDOWS: + if: fromJson(inputs.branch).jobs.WINDOWS strategy: fail-fast: false - matrix: - include: - - x64: true - zts: true - opcache: true - asan: false - - x64: false - zts: false - opcache: false - asan: false - - x64: true - zts: true - opcache: true - asan: true - branch: 'master' - timeout: 120 + matrix: ${{ fromJson(inputs.branch).jobs.WINDOWS.matrix }} name: "WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || ''}}" - runs-on: windows-${{ inputs.windows_version }} + runs-on: windows-2022 env: PHP_BUILD_CACHE_BASE_DIR: C:\build-cache PHP_BUILD_OBJ_DIR: C:\obj PHP_BUILD_CACHE_SDK_DIR: C:\build-cache\sdk PHP_BUILD_SDK_BRANCH: php-sdk-2.5.0 - PHP_BUILD_CRT: ${{ inputs.vs_crt_version }} + PHP_BUILD_CRT: ${{ fromJson(inputs.branch).jobs.WINDOWS.config.vs_crt_version }} PLATFORM: ${{ matrix.x64 && 'x64' || 'x86' }} THREAD_SAFE: "${{ matrix.zts && '1' || '0' }}" INTRINSICS: "${{ matrix.zts && 'AVX2' || '' }}" @@ -998,7 +926,7 @@ jobs: - name: git checkout uses: actions/checkout@v6 with: - ref: ${{ inputs.branch }} + ref: ${{ fromJson(inputs.branch).ref }} - name: Setup uses: ./.github/actions/setup-windows - name: Build @@ -1006,12 +934,10 @@ jobs: - name: Test run: .github/scripts/windows/test.bat FREEBSD: + if: fromJson(inputs.branch).jobs.FREEBSD strategy: fail-fast: false - matrix: - zts: [true, false] - exclude: - - zts: ${{ !inputs.run_freebsd_zts && true || '*never*' }} + matrix: ${{ fromJson(inputs.branch).jobs.FREEBSD.matrix }} name: "FREEBSD_${{ matrix.zts && 'ZTS' || 'NTS' }}" runs-on: ubuntu-latest timeout-minutes: 50 @@ -1019,7 +945,7 @@ jobs: - name: git checkout uses: actions/checkout@v6 with: - ref: ${{ inputs.branch }} + ref: ${{ fromJson(inputs.branch).ref }} - name: FreeBSD uses: ./.github/actions/freebsd with: diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 4f1c53c023025..51b33262991a2 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -31,269 +31,29 @@ env: CC: ccache gcc CXX: ccache g++ jobs: - ALPINE: - if: github.repository == 'php/php-src' || github.event_name == 'pull_request' - name: ALPINE_X64_ASAN_UBSAN_DEBUG_ZTS - runs-on: ubuntu-24.04 - container: - image: 'alpine:3.22' - steps: - - name: git checkout - uses: actions/checkout@v6 - - name: apk - uses: ./.github/actions/apk - - name: System info - run: | - echo "::group::Show host CPU info" - lscpu - echo "::endgroup::" - echo "::group::Show installed package versions" - apk list - echo "::endgroup::" - - name: ./configure - uses: ./.github/actions/configure-alpine - with: - configurationParameters: >- - CFLAGS="-fsanitize=undefined,address -fno-sanitize=function -DZEND_TRACK_ARENA_ALLOC" - LDFLAGS="-fsanitize=undefined,address -fno-sanitize=function" - CC=clang-20 - CXX=clang++-20 - --enable-debug - --enable-zts - skipSlow: true # FIXME: This should likely include slow extensions - - name: make - run: make -j$(/usr/bin/nproc) >/dev/null - - name: make install - uses: ./.github/actions/install-alpine - - name: Test Tracing JIT - uses: ./.github/actions/test-alpine - with: - jitType: tracing - runTestsParameters: >- - --asan -x - -d opcache.enable_cli=1 - LINUX_X64: - if: github.repository == 'php/php-src' || github.event_name == 'pull_request' - services: - mysql: - image: mysql:8.4 - ports: - - 3306:3306 - env: - MYSQL_DATABASE: test - MYSQL_ROOT_PASSWORD: root - postgres: - image: postgres - ports: - - 5432:5432 - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: test - firebird: - image: jacobalberty/firebird - ports: - - 3050:3050 - env: - ISC_PASSWORD: test - FIREBIRD_DATABASE: test.fdb - FIREBIRD_USER: test - FIREBIRD_PASSWORD: test - strategy: - fail-fast: false - matrix: - include: - - debug: false - zts: false - asan: false - - debug: true - zts: true - asan: true - name: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}" - runs-on: ubuntu-24.04 - timeout-minutes: 50 - steps: - - name: git checkout - uses: actions/checkout@v6 - - name: apt - uses: ./.github/actions/apt-x64 - - name: System info - run: | - echo "::group::Show host CPU info" - lscpu - echo "::endgroup::" - echo "::group::Show installed package versions" - dpkg -l - echo "::endgroup::" - - name: Create MSSQL container - if: ${{ !matrix.asan }} - uses: ./.github/actions/setup-mssql - - name: Setup Caddy server - uses: ./.github/actions/setup-caddy - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - # This duplicates the "job.name" expression above because - # GitHub has no way to query the job name (github.job is the - # job id, not the job name) - key: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}-${{hashFiles('main/php_version.h')}}" - append-timestamp: false - save: ${{ github.event_name != 'pull_request' }} - - name: ./configure - uses: ./.github/actions/configure-x64 - with: - configurationParameters: >- - --${{ matrix.debug && 'enable' || 'disable' }}-debug - ${{ matrix.debug && 'CXXFLAGS="-D_GLIBCXX_ASSERTIONS"' || '' }} - --${{ matrix.zts && 'enable' || 'disable' }}-zts - ${{ matrix.asan && 'CFLAGS="-fsanitize=undefined,address -fno-sanitize=function -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address -fno-sanitize=function" CC=clang CXX=clang++' || '' }} - skipSlow: ${{ matrix.asan }} - - name: make - run: make -j$(/usr/bin/nproc) >/dev/null - - name: make install - uses: ./.github/actions/install-linux - - name: Setup - if: ${{ !matrix.asan }} - uses: ./.github/actions/setup-x64 - - name: Test - if: matrix.asan == false - uses: ./.github/actions/test-linux - - name: Test Tracing JIT - uses: ./.github/actions/test-linux - with: - jitType: tracing - runTestsParameters: >- - -d opcache.enable_cli=1 - ${{ matrix.asan && '--asan -x' || '' }} - - name: Verify generated files are up to date - if: ${{ !matrix.asan }} - uses: ./.github/actions/verify-generated-files - LINUX_X32: - if: github.repository == 'php/php-src' || github.event_name == 'pull_request' - name: LINUX_X32_DEBUG_ZTS + GENERATE_MATRIX: + name: Generate Matrix runs-on: ubuntu-latest - timeout-minutes: 50 - container: - image: ubuntu:24.04 - env: - MYSQL_TEST_HOST: mysql - PDO_MYSQL_TEST_DSN: mysql:host=mysql;dbname=test - PDO_MYSQL_TEST_HOST: mysql - PDO_FIREBIRD_TEST_DSN: firebird:dbname=firebird:test.fdb - services: - mysql: - image: mysql:8.4 - ports: - - 3306:3306 - env: - MYSQL_DATABASE: test - MYSQL_ROOT_PASSWORD: root - firebird: - image: jacobalberty/firebird - ports: - - 3050:3050 - env: - ISC_PASSWORD: test - FIREBIRD_DATABASE: test.fdb - FIREBIRD_USER: test - FIREBIRD_PASSWORD: test + outputs: + branches: ${{ steps.set-matrix.outputs.branches }} + comprehensive: ${{ steps.set-matrix.outputs.comprehensive }} steps: - - name: git checkout - uses: actions/checkout@v6 - - name: apt - uses: ./.github/actions/apt-x32 - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: "${{github.job}}-${{hashFiles('main/php_version.h')}}" - append-timestamp: false - save: ${{ github.event_name != 'pull_request' }} - - name: ./configure - uses: ./.github/actions/configure-x32 - with: - configurationParameters: >- - --enable-debug - --enable-zts - - name: make - run: make -j$(/usr/bin/nproc) >/dev/null - - name: make install - uses: ./.github/actions/install-linux-x32 - - name: Test Tracing JIT - uses: ./.github/actions/test-linux - with: - jitType: tracing - runTestsParameters: >- - -d opcache.enable_cli=1 - MACOS_DEBUG_NTS: - if: github.repository == 'php/php-src' || github.event_name == 'pull_request' + - uses: actions/checkout@v6 + - name: Generate Matrix + id: set-matrix + run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.head_ref || github.ref_name }}" '${{ toJSON(github.event.pull_request.labels) }}' + PUSH: + needs: GENERATE_MATRIX + name: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches)[0].ref }} + uses: ./.github/workflows/nightly.yml strategy: fail-fast: false matrix: - include: - - os: 15 - arch: ARM64 - name: MACOS_${{ matrix.arch }}_DEBUG_NTS - runs-on: macos-${{ matrix.os }} - timeout-minutes: 50 - steps: - - name: git checkout - uses: actions/checkout@v6 - - name: Update clang - uses: ./.github/actions/macos-update-clang - - name: brew - timeout-minutes: 10 - uses: ./.github/actions/brew - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: "${{github.job}}-${{matrix.os}}-${{hashFiles('main/php_version.h')}}" - append-timestamp: false - save: ${{ github.event_name != 'pull_request' }} - - name: ./configure - uses: ./.github/actions/configure-macos - with: - configurationParameters: --enable-debug --disable-zts - - name: make - run: |- - export PATH="$(brew --prefix)/opt/bison/bin:$PATH" - make -j$(sysctl -n hw.logicalcpu) >/dev/null - - name: make install - run: sudo make install - - name: Test Tracing JIT - uses: ./.github/actions/test-macos - with: - jitType: tracing - runTestsParameters: >- - -d opcache.enable_cli=1 - - name: Verify generated files are up to date - uses: ./.github/actions/verify-generated-files - WINDOWS: - if: github.repository == 'php/php-src' || github.event_name == 'pull_request' - name: WINDOWS_X64_ZTS - runs-on: windows-2022 - timeout-minutes: 50 - env: - PHP_BUILD_CACHE_BASE_DIR: C:\build-cache - PHP_BUILD_OBJ_DIR: C:\obj - PHP_BUILD_CACHE_SDK_DIR: C:\build-cache\sdk - PHP_BUILD_SDK_BRANCH: php-sdk-2.5.0 - PHP_BUILD_CRT: vs17 - PLATFORM: x64 - THREAD_SAFE: "1" - INTRINSICS: AVX2 - PARALLEL: -j2 - OPCACHE: "1" - steps: - - name: git config - run: git config --global core.autocrlf false && git config --global core.eol lf - - name: git checkout - uses: actions/checkout@v6 - - name: Setup - uses: ./.github/actions/setup-windows - - name: Build - run: .github/scripts/windows/build.bat - - name: Test - run: .github/scripts/windows/test.bat + branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }} + with: + branch: ${{ toJSON(matrix.branch) }} + comprehensive: ${{ needs.GENERATE_MATRIX.outputs.comprehensive == 'true' && true || false }} + secrets: inherit BENCHMARKING: name: BENCHMARKING if: github.repository == 'php/php-src' || github.event_name == 'pull_request' @@ -399,13 +159,3 @@ jobs: name: profiles path: ${{ github.workspace }}/benchmark/profiles retention-days: 30 - FREEBSD: - if: github.repository == 'php/php-src' || github.event_name == 'pull_request' - name: FREEBSD - runs-on: ubuntu-latest - timeout-minutes: 50 - steps: - - name: git checkout - uses: actions/checkout@v6 - - name: FreeBSD - uses: ./.github/actions/freebsd diff --git a/.github/workflows/root.yml b/.github/workflows/root.yml index 8302175d638fb..c7ed311260c58 100644 --- a/.github/workflows/root.yml +++ b/.github/workflows/root.yml @@ -12,6 +12,7 @@ jobs: runs-on: ubuntu-latest outputs: branches: ${{ steps.set-matrix.outputs.branches }} + comprehensive: ${{ steps.set-matrix.outputs.comprehensive }} steps: - uses: actions/checkout@v6 with: @@ -41,23 +42,6 @@ jobs: matrix: branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }} with: - asan_ubuntu_version: ${{ - (((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 5) || matrix.branch.version[0] >= 9) && '24.04') - || '22.04' }} - branch: ${{ matrix.branch.ref }} - community_verify_type_inference: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9 }} - macos_arm64_version: ${{ ((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 5) || matrix.branch.version[0] >= 9) && '15' || '14' }} - run_alpine: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9 }} - run_linux_ppc64: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9 }} - run_macos_arm64: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9 }} - run_freebsd_zts: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 3) || matrix.branch.version[0] >= 9 }} - ubuntu_version: ${{ - (((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 5) || matrix.branch.version[0] >= 9) && '24.04') - || '22.04' }} - windows_version: '2022' - vs_crt_version: ${{ ((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) && 'vs17') || 'vs16' }} - skip_laravel: false - symfony_version: ${{ (((matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 4) || matrix.branch.version[0] >= 9) && '8.1') || '7.4' }} - skip_wordpress: false - variation_enable_zend_max_execution_timers: ${{ (matrix.branch.version[0] == 8 && matrix.branch.version[1] >= 3) || matrix.branch.version[0] >= 9 }} + branch: ${{ toJSON(matrix.branch) }} + comprehensive: ${{ needs.GENERATE_MATRIX.outputs.comprehensive == 'true' && true || false }} secrets: inherit From f03e21bc000b6b4d700800ad67b972c336964647 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Sun, 8 Feb 2026 23:48:36 +0100 Subject: [PATCH 02/11] Adjust matrix ref I'll need to make sure this doesn't break the nightly cron. --- .github/workflows/push.yml | 2 +- .github/workflows/root.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 51b33262991a2..85f015a3fd5ca 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -41,7 +41,7 @@ jobs: - uses: actions/checkout@v6 - name: Generate Matrix id: set-matrix - run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.head_ref || github.ref_name }}" '${{ toJSON(github.event.pull_request.labels) }}' + run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.ref }}" '${{ toJSON(github.event.pull_request.labels) }}' PUSH: needs: GENERATE_MATRIX name: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches)[0].ref }} diff --git a/.github/workflows/root.yml b/.github/workflows/root.yml index c7ed311260c58..7ce540218f549 100644 --- a/.github/workflows/root.yml +++ b/.github/workflows/root.yml @@ -31,7 +31,7 @@ jobs: nightly- - name: Generate Matrix id: set-matrix - run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.head_ref || github.ref_name }}" + run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.ref }}" NIGHTLY: needs: GENERATE_MATRIX name: ${{ matrix.branch.ref }} From 5bbc5b3c253163050b8b96722b36dfc8a90fe4dd Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Mon, 9 Feb 2026 19:35:30 +0100 Subject: [PATCH 03/11] Copy missing parts from old push.yml file --- .github/workflows/nightly.yml | 39 ++++++++++++++++++++++++++++------- .github/workflows/push.yml | 1 + 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d1ea884777240..82aa3f4f9a8a8 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -145,6 +145,17 @@ jobs: echo "::group::Show installed package versions" dpkg -l echo "::endgroup::" + - name: Setup Caddy server + uses: ./.github/actions/setup-caddy + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + # This duplicates the "job.name" expression above because + # GitHub has no way to query the job name (github.job is the + # job id, not the job name) + key: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}-${{hashFiles('main/php_version.h')}}" + append-timestamp: false + save: ${{ github.event_name != 'pull_request' }} - name: ./configure uses: ./.github/actions/configure-x64 with: @@ -153,14 +164,16 @@ jobs: ${{ matrix.variation && 'CFLAGS="-DZEND_RC_DEBUG=1 -DPROFITABILITY_CHECKS=0 -DZEND_VERIFY_FUNC_INFO=1 -DZEND_VERIFY_TYPE_INFERENCE"' || '' }} ${{ (matrix.variation && fromJson(inputs.branch).jobs.LINUX_X64.config.variation_enable_zend_max_execution_timers) && '--enable-zend-max-execution-timers' || '' }} --${{ matrix.debug && 'enable' || 'disable' }}-debug + ${{ matrix.debug && 'CXXFLAGS="-D_GLIBCXX_ASSERTIONS"' || '' }} --${{ matrix.zts && 'enable' || 'disable' }}-zts asan: ${{ matrix.asan && 'true' || 'false' }} - skipSlow: ${{ (matrix.asan && !matrix.comprehensive) && 'true' || 'false' }} + skipSlow: ${{ (matrix.asan && !inputs.comprehensive) && 'true' || 'false' }} - name: make run: make -j$(/usr/bin/nproc) >/dev/null - name: make install uses: ./.github/actions/install-linux - name: Setup + if: ${{ !matrix.asan && !inputs.comprehensive }} uses: ./.github/actions/setup-x64 - name: Test if: ${{ inputs.comprehensive || !matrix.asan }} @@ -177,6 +190,7 @@ jobs: jitType: tracing runTestsParameters: >- ${{ matrix.asan && '--asan' || '' }} + ${{ (matrix.asan && !inputs.comprehensive) && '-x' || '' }} ${{ matrix.repeat && '--repeat 2' || '' }} ${{ matrix.variation && '-d zend_test.observer.enabled=1 -d zend_test.observer.show_output=0' || '' }} -d opcache.enable_cli=1 @@ -214,6 +228,9 @@ jobs: container: image: ubuntu:${{ fromJson(inputs.branch).config.ubuntu_version }} env: + MYSQL_TEST_HOST: mysql + PDO_MYSQL_TEST_DSN: mysql:host=mysql;dbname=test + PDO_MYSQL_TEST_HOST: mysql PDO_FIREBIRD_TEST_DSN: firebird:dbname=firebird:test.fdb services: mysql: @@ -239,6 +256,12 @@ jobs: ref: ${{ fromJson(inputs.branch).ref }} - name: apt uses: ./.github/actions/apt-x32 + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: "${{github.job}}-${{hashFiles('main/php_version.h')}}" + append-timestamp: false + save: ${{ github.event_name != 'pull_request' }} - name: System info run: | echo "::group::Show host CPU info" @@ -260,22 +283,17 @@ jobs: - name: Test if: ${{ inputs.comprehensive }} uses: ./.github/actions/test-linux - with: - runTestsParameters: >- - ${{ matrix.run_tests_parameters }} - name: Test Tracing JIT uses: ./.github/actions/test-linux with: jitType: tracing runTestsParameters: >- - ${{ matrix.run_tests_parameters }} -d opcache.enable_cli=1 - name: Test OpCache if: ${{ inputs.comprehensive }} uses: ./.github/actions/test-linux with: runTestsParameters: >- - ${{ matrix.run_tests_parameters }} -d opcache.enable_cli=1 - name: Test Function JIT if: ${{ inputs.comprehensive }} @@ -283,7 +301,6 @@ jobs: with: jitType: function runTestsParameters: >- - ${{ matrix.run_tests_parameters }} -d opcache.enable_cli=1 - name: Extra tests uses: ./.github/actions/extra-tests @@ -304,6 +321,12 @@ jobs: - name: brew timeout-minutes: 10 uses: ./.github/actions/brew + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: "${{github.job}}-${{matrix.os}}-${{hashFiles('main/php_version.h')}}" + append-timestamp: false + save: ${{ github.event_name != 'pull_request' }} - name: ./configure uses: ./.github/actions/configure-macos with: @@ -327,7 +350,7 @@ jobs: runTestsParameters: >- -d opcache.enable_cli=1 - name: Test OpCache - if: ${{ inputs.comprehensive }} + if: ${{ inputs.comprehensive || (matrix.arch == 'ARM64' && matrix.zts) }} uses: ./.github/actions/test-macos with: runTestsParameters: >- diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 85f015a3fd5ca..3aa9bd7dd8212 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -33,6 +33,7 @@ env: jobs: GENERATE_MATRIX: name: Generate Matrix + if: github.repository == 'php/php-src' || github.event_name == 'pull_request' runs-on: ubuntu-latest outputs: branches: ${{ steps.set-matrix.outputs.branches }} From 35c0da22ddd77750ae616821aa0ec1ef4d57ac3e Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Mon, 9 Feb 2026 19:58:04 +0100 Subject: [PATCH 04/11] Improve ccache key --- .github/actions/ccache/action.yml | 19 +++++++++++++++++++ .github/workflows/nightly.yml | 24 ++++++++---------------- .github/workflows/push.yml | 6 ++---- .github/workflows/unit-tests.yml | 15 ++++++--------- 4 files changed, 35 insertions(+), 29 deletions(-) create mode 100644 .github/actions/ccache/action.yml diff --git a/.github/actions/ccache/action.yml b/.github/actions/ccache/action.yml new file mode 100644 index 0000000000000..087a855cc5ea0 --- /dev/null +++ b/.github/actions/ccache/action.yml @@ -0,0 +1,19 @@ +name: ccache +inputs: + name: + required: true +runs: + using: composite + steps: + - name: Get PHP version + shell: bash + id: php_version + run: | + echo "major=$(cat main/php_version.h | sed -n 's/^#define PHP_MAJOR_VERSION \([0-9]\+\)/\1/p')" >> $GITHUB_OUTPUT + echo "minor=$(cat main/php_version.h | sed -n 's/^#define PHP_MINOR_VERSION \([0-9]\+\)/\1/p')" >> $GITHUB_OUTPUT + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: "${{ inputs.name }}-${{ steps.php_version.outputs.major }}.${{ steps.php_version.outputs.minor }}" + append-timestamp: false + save: ${{ github.event_name != 'pull_request' }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 82aa3f4f9a8a8..698d3b59bae77 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -148,14 +148,12 @@ jobs: - name: Setup Caddy server uses: ./.github/actions/setup-caddy - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 + uses: ./.github/actions/ccache with: # This duplicates the "job.name" expression above because # GitHub has no way to query the job name (github.job is the # job id, not the job name) - key: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}-${{hashFiles('main/php_version.h')}}" - append-timestamp: false - save: ${{ github.event_name != 'pull_request' }} + name: "LINUX_X64${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" - name: ./configure uses: ./.github/actions/configure-x64 with: @@ -257,11 +255,9 @@ jobs: - name: apt uses: ./.github/actions/apt-x32 - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 + uses: ./.github/actions/ccache with: - key: "${{github.job}}-${{hashFiles('main/php_version.h')}}" - append-timestamp: false - save: ${{ github.event_name != 'pull_request' }} + name: "LINUX_X32_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" - name: System info run: | echo "::group::Show host CPU info" @@ -322,11 +318,9 @@ jobs: timeout-minutes: 10 uses: ./.github/actions/brew - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 + uses: ./.github/actions/ccache with: - key: "${{github.job}}-${{matrix.os}}-${{hashFiles('main/php_version.h')}}" - append-timestamp: false - save: ${{ github.event_name != 'pull_request' }} + name: "MACOS_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" - name: ./configure uses: ./.github/actions/configure-macos with: @@ -869,11 +863,9 @@ jobs: bison \ re2c - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 + uses: ./.github/actions/ccache with: - key: "${{github.job}}-${{hashFiles('php/main/php_version.h')}}" - append-timestamp: false - save: ${{ github.event_name != 'pull_request' }} + name: "${{ github.job }}" - name: build PHP run: | cd php diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 3aa9bd7dd8212..d56919c6f9617 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -82,11 +82,9 @@ jobs: re2c \ valgrind - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 + uses: ./.github/actions/ccache with: - key: "${{github.job}}-${{hashFiles('main/php_version.h')}}" - append-timestamp: false - save: ${{ github.event_name != 'pull_request' }} + name: "${{ github.job }}" - name: ./configure run: | set -x diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 6338a1cb945db..4cd92ad703bbe 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -36,7 +36,7 @@ jobs: steps: - name: git checkout uses: actions/checkout@v6 - + - name: Install dependencies run: | set -x @@ -53,23 +53,20 @@ jobs: ccache - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 + uses: ./.github/actions/ccache with: - key: "unit-tests-${{hashFiles('main/php_version.h')}}" - append-timestamp: false - save: ${{ github.event_name != 'pull_request' }} - + name: "${{ github.job }}" + - name: ./configure (minimal build) uses: ./.github/actions/configure-unit-tests - + - name: make libphp.a run: | set -x make -j$(/usr/bin/nproc) >/dev/null - + - name: Run unit tests run: | set -x cd tests/unit make test - From 08b5240d9a09beb7cd0d587b5546c93fd701edbd Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Mon, 9 Feb 2026 23:57:23 +0100 Subject: [PATCH 05/11] Fix broken setup condition asan && !comprehensive doesn't require setup, so the negation would be !asan || comprehensive. --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 698d3b59bae77..6fcb2c9c5248e 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -171,7 +171,7 @@ jobs: - name: make install uses: ./.github/actions/install-linux - name: Setup - if: ${{ !matrix.asan && !inputs.comprehensive }} + if: ${{ !matrix.asan || inputs.comprehensive }} uses: ./.github/actions/setup-x64 - name: Test if: ${{ inputs.comprehensive || !matrix.asan }} From f9bad8cdf659da852dec870f9c9cb219b443073a Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Tue, 10 Feb 2026 15:09:55 +0100 Subject: [PATCH 06/11] [skip ci] Rename labels "Enable all" -> "All jobs" "Disable all" -> "No jobs" "Comprehensive" -> "All variations" --- .github/nightly_matrix.php | 46 +++++++++++++++++------------------ .github/workflows/nightly.yml | 30 +++++++++++------------ .github/workflows/push.yml | 4 +-- .github/workflows/root.yml | 4 +-- 4 files changed, 42 insertions(+), 42 deletions(-) diff --git a/.github/nightly_matrix.php b/.github/nightly_matrix.php index 18ad6c008b59f..c0a3fadc39152 100644 --- a/.github/nightly_matrix.php +++ b/.github/nightly_matrix.php @@ -46,9 +46,9 @@ function get_current_version(): array { return [$major, $minor]; } -function select_jobs($trigger, $labels, $php_version, $ref, $comprehensive) { - $disable_all = in_array('CI: Disable all', $labels, true); - $enable_all = in_array('CI: Enable all', $labels, true); +function select_jobs($trigger, $labels, $php_version, $ref, $all_variations) { + $no_jobs = in_array('CI: No jobs', $labels, true); + $all_jobs = in_array('CI: All jobs', $labels, true); $test_alpine = in_array('CI: Alpine', $labels, true); $test_benchmarking = in_array('CI: Benchmarking', $labels, true); $test_community = in_array('CI: Community', $labels, true); @@ -63,10 +63,10 @@ function select_jobs($trigger, $labels, $php_version, $ref, $comprehensive) { $test_windows = in_array('CI: Windows', $labels, true); $jobs = []; - if (version_compare($php_version, '8.4', '>=') && ($enable_all || !$disable_all || $test_alpine)) { + if (version_compare($php_version, '8.4', '>=') && ($all_jobs || !$no_jobs || $test_alpine)) { $jobs['ALPINE'] = true; } - if ($enable_all || $test_community) { + if ($all_jobs || $test_community) { $jobs['COMMUNITY']['matrix'] = version_compare($php_version, '8.4', '>=') ? ['type' => ['asan', 'verify_type_inference']] : ['type' => ['asan']]; @@ -75,14 +75,14 @@ function select_jobs($trigger, $labels, $php_version, $ref, $comprehensive) { if ($trigger === 'schedule' && $ref === 'master') { $jobs['COVERAGE'] = true; } - if ($enable_all || $test_libmysqlclient) { + if ($all_jobs || $test_libmysqlclient) { $jobs['LIBMYSQLCLIENT'] = true; } - if (version_compare($php_version, '8.4', '>=') && ($enable_all || $test_linux_ppc64)) { + if (version_compare($php_version, '8.4', '>=') && ($all_jobs || $test_linux_ppc64)) { $jobs['LINUX_PPC64'] = true; } - if ($enable_all || !$disable_all || $test_linux_x64) { - $jobs['LINUX_X64']['matrix'] = $comprehensive + if ($all_jobs || !$no_jobs || $test_linux_x64) { + $jobs['LINUX_X64']['matrix'] = $all_variations ? [ 'name' => [''], 'asan' => [false], @@ -102,30 +102,30 @@ function select_jobs($trigger, $labels, $php_version, $ref, $comprehensive) { ]]; $jobs['LINUX_X64']['config']['variation_enable_zend_max_execution_timers'] = version_compare($php_version, '8.3', '>='); } - if ($enable_all || !$disable_all || $test_linux_x32) { - $jobs['LINUX_X32']['matrix'] = $comprehensive + if ($all_jobs || !$no_jobs || $test_linux_x32) { + $jobs['LINUX_X32']['matrix'] = $all_variations ? ['debug' => [true, false], 'zts' => [true, false]] : ['debug' => [true], 'zts' => [true]]; } - if ($enable_all || !$disable_all || $test_macos) { + if ($all_jobs || !$no_jobs || $test_macos) { $test_arm = version_compare($php_version, '8.4', '>='); - $jobs['MACOS']['matrix'] = $comprehensive + $jobs['MACOS']['matrix'] = $all_variations ? ['arch' => $test_arm ? ['X64', 'ARM64'] : ['X64'], 'debug' => [true, false], 'zts' => [true, false]] : ['include' => [['arch' => $test_arm ? 'ARM64' : 'X64', 'debug' => true, 'zts' => false]]]; $jobs['MACOS']['config']['arm64_version'] = version_compare($php_version, '8.4', '>=') ? '15' : '14'; } - if ($enable_all || $test_msan) { + if ($all_jobs || $test_msan) { $jobs['MSAN'] = true; } - if ($enable_all || $test_opcache_variation) { + if ($all_jobs || $test_opcache_variation) { $jobs['OPCACHE_VARIATION'] = true; } if ($trigger === 'schedule' && $ref === 'master') { $jobs['PECL'] = true; } - if ($enable_all || !$disable_all || $test_windows) { + if ($all_jobs || !$no_jobs || $test_windows) { $windows_jobs = ['include' => [['asan' => true, 'opcache' => true, 'x64' => true, 'zts' => true]]]; - if ($comprehensive) { + if ($all_variations) { $windows_jobs['include'][] = ['asan' => false, 'opcache' => false, 'x64' => false, 'zts' => false]; } $jobs['WINDOWS']['matrix'] = $windows_jobs; @@ -133,11 +133,11 @@ function select_jobs($trigger, $labels, $php_version, $ref, $comprehensive) { ? ['vs_crt_version' => 'vs17'] : ['vs_crt_version' => 'vs16']; } - if ($enable_all || !$disable_all || $test_benchmarking) { + if ($all_jobs || !$no_jobs || $test_benchmarking) { $jobs['BENCHMARKING'] = true; } - if ($enable_all || !$disable_all || $test_freebsd) { - $jobs['FREEBSD']['matrix'] = $comprehensive && version_compare($php_version, '8.3', '>=') + if ($all_jobs || !$no_jobs || $test_freebsd) { + $jobs['FREEBSD']['matrix'] = $all_variations && version_compare($php_version, '8.3', '>=') ? ['zts' => [true, false]] : ['zts' => [false]]; } @@ -160,15 +160,15 @@ function select_jobs($trigger, $labels, $php_version, $ref, $comprehensive) { $labels = json_decode($argv[4] ?? '[]', true); $labels = array_column($labels, 'name'); -$comprehensive = $trigger === 'schedule' || $trigger === 'workflow_dispatch' || in_array('CI: Comprehensive', $labels, true); +$all_variations = $trigger === 'schedule' || $trigger === 'workflow_dispatch' || in_array('CI: All variations', $labels, true); foreach ($branches as &$branch) { $php_version = $branch['version'][0] . '.' . $branch['version'][1]; - $branch['jobs'] = select_jobs($trigger, $labels, $php_version, $branch['ref'], $comprehensive); + $branch['jobs'] = select_jobs($trigger, $labels, $php_version, $branch['ref'], $all_variations); $branch['config']['ubuntu_version'] = version_compare($php_version, '8.5', '>=') ? '24.04' : '22.04'; } $f = fopen(getenv('GITHUB_OUTPUT'), 'a'); fwrite($f, 'branches=' . json_encode($branches, JSON_UNESCAPED_SLASHES) . "\n"); -fwrite($f, 'comprehensive=' . json_encode($comprehensive, JSON_UNESCAPED_SLASHES) . "\n"); +fwrite($f, 'all_variations=' . json_encode($all_variations, JSON_UNESCAPED_SLASHES) . "\n"); fclose($f); diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 6fcb2c9c5248e..dc0f8d3e3b5ff 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -2,12 +2,12 @@ name: Test suite on: workflow_call: inputs: + all_variations: + required: true + type: boolean branch: required: true type: string - comprehensive: - required: true - type: boolean permissions: contents: read jobs: @@ -165,16 +165,16 @@ jobs: ${{ matrix.debug && 'CXXFLAGS="-D_GLIBCXX_ASSERTIONS"' || '' }} --${{ matrix.zts && 'enable' || 'disable' }}-zts asan: ${{ matrix.asan && 'true' || 'false' }} - skipSlow: ${{ (matrix.asan && !inputs.comprehensive) && 'true' || 'false' }} + skipSlow: ${{ (matrix.asan && !inputs.all_variations) && 'true' || 'false' }} - name: make run: make -j$(/usr/bin/nproc) >/dev/null - name: make install uses: ./.github/actions/install-linux - name: Setup - if: ${{ !matrix.asan || inputs.comprehensive }} + if: ${{ !matrix.asan || inputs.all_variations }} uses: ./.github/actions/setup-x64 - name: Test - if: ${{ inputs.comprehensive || !matrix.asan }} + if: ${{ inputs.all_variations || !matrix.asan }} uses: ./.github/actions/test-linux with: runTestsParameters: >- @@ -188,12 +188,12 @@ jobs: jitType: tracing runTestsParameters: >- ${{ matrix.asan && '--asan' || '' }} - ${{ (matrix.asan && !inputs.comprehensive) && '-x' || '' }} + ${{ (matrix.asan && !inputs.all_variations) && '-x' || '' }} ${{ matrix.repeat && '--repeat 2' || '' }} ${{ matrix.variation && '-d zend_test.observer.enabled=1 -d zend_test.observer.show_output=0' || '' }} -d opcache.enable_cli=1 - name: Test OpCache - if: ${{ inputs.comprehensive }} + if: ${{ inputs.all_variations }} uses: ./.github/actions/test-linux with: runTestsParameters: >- @@ -204,7 +204,7 @@ jobs: - name: Test Function JIT # ASAN frequently timeouts. Each test run takes ~90 minutes, we can # avoid running into the 6 hour timeout by skipping the function JIT. - if: ${{ inputs.comprehensive && !matrix.asan }} + if: ${{ inputs.all_variations && !matrix.asan }} uses: ./.github/actions/test-linux with: jitType: function @@ -277,7 +277,7 @@ jobs: - name: make install uses: ./.github/actions/install-linux-x32 - name: Test - if: ${{ inputs.comprehensive }} + if: ${{ inputs.all_variations }} uses: ./.github/actions/test-linux - name: Test Tracing JIT uses: ./.github/actions/test-linux @@ -286,13 +286,13 @@ jobs: runTestsParameters: >- -d opcache.enable_cli=1 - name: Test OpCache - if: ${{ inputs.comprehensive }} + if: ${{ inputs.all_variations }} uses: ./.github/actions/test-linux with: runTestsParameters: >- -d opcache.enable_cli=1 - name: Test Function JIT - if: ${{ inputs.comprehensive }} + if: ${{ inputs.all_variations }} uses: ./.github/actions/test-linux with: jitType: function @@ -334,7 +334,7 @@ jobs: - name: make install run: sudo make install - name: Test - if: ${{ inputs.comprehensive }} + if: ${{ inputs.all_variations }} uses: ./.github/actions/test-macos - name: Test Tracing JIT if: matrix.arch == 'X64' || !matrix.zts @@ -344,13 +344,13 @@ jobs: runTestsParameters: >- -d opcache.enable_cli=1 - name: Test OpCache - if: ${{ inputs.comprehensive || (matrix.arch == 'ARM64' && matrix.zts) }} + if: ${{ inputs.all_variations || (matrix.arch == 'ARM64' && matrix.zts) }} uses: ./.github/actions/test-macos with: runTestsParameters: >- -d opcache.enable_cli=1 - name: Test Function JIT - if: inputs.comprehensive && (matrix.arch == 'X64' || !matrix.zts) + if: inputs.all_variations && (matrix.arch == 'X64' || !matrix.zts) uses: ./.github/actions/test-macos with: jitType: function diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index d56919c6f9617..842ed83b531ef 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -36,8 +36,8 @@ jobs: if: github.repository == 'php/php-src' || github.event_name == 'pull_request' runs-on: ubuntu-latest outputs: + all_variations: ${{ steps.set-matrix.outputs.all_variations }} branches: ${{ steps.set-matrix.outputs.branches }} - comprehensive: ${{ steps.set-matrix.outputs.comprehensive }} steps: - uses: actions/checkout@v6 - name: Generate Matrix @@ -52,8 +52,8 @@ jobs: matrix: branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }} with: + all_variations: ${{ needs.GENERATE_MATRIX.outputs.all_variations == 'true' && true || false }} branch: ${{ toJSON(matrix.branch) }} - comprehensive: ${{ needs.GENERATE_MATRIX.outputs.comprehensive == 'true' && true || false }} secrets: inherit BENCHMARKING: name: BENCHMARKING diff --git a/.github/workflows/root.yml b/.github/workflows/root.yml index 7ce540218f549..f1936547ca618 100644 --- a/.github/workflows/root.yml +++ b/.github/workflows/root.yml @@ -11,8 +11,8 @@ jobs: if: github.repository == 'php/php-src' || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest outputs: + all_variations: ${{ steps.set-matrix.outputs.all_variations }} branches: ${{ steps.set-matrix.outputs.branches }} - comprehensive: ${{ steps.set-matrix.outputs.comprehensive }} steps: - uses: actions/checkout@v6 with: @@ -42,6 +42,6 @@ jobs: matrix: branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }} with: + all_variations: ${{ needs.GENERATE_MATRIX.outputs.all_variations == 'true' && true || false }} branch: ${{ toJSON(matrix.branch) }} - comprehensive: ${{ needs.GENERATE_MATRIX.outputs.comprehensive == 'true' && true || false }} secrets: inherit From 7c273bae29bcbebb9016d8c4b838ed559a77871c Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Tue, 10 Feb 2026 15:17:21 +0100 Subject: [PATCH 07/11] [skip ci] Revert ccache version change This will be improved for GH-14154 anyway. --- .github/actions/ccache/action.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/actions/ccache/action.yml b/.github/actions/ccache/action.yml index 087a855cc5ea0..fbd8691c927e2 100644 --- a/.github/actions/ccache/action.yml +++ b/.github/actions/ccache/action.yml @@ -5,15 +5,9 @@ inputs: runs: using: composite steps: - - name: Get PHP version - shell: bash - id: php_version - run: | - echo "major=$(cat main/php_version.h | sed -n 's/^#define PHP_MAJOR_VERSION \([0-9]\+\)/\1/p')" >> $GITHUB_OUTPUT - echo "minor=$(cat main/php_version.h | sed -n 's/^#define PHP_MINOR_VERSION \([0-9]\+\)/\1/p')" >> $GITHUB_OUTPUT - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: - key: "${{ inputs.name }}-${{ steps.php_version.outputs.major }}.${{ steps.php_version.outputs.minor }}" + key: "${{ inputs.name }}-${{ hashFiles('main/php_version.h') }}" append-timestamp: false save: ${{ github.event_name != 'pull_request' }} From 85efad86fd17a61706e93c0bf624491e3f4a0407 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Tue, 10 Feb 2026 15:19:07 +0100 Subject: [PATCH 08/11] Trigger CI From 65c7c33d04a2099079616d14f8910a525e90c120 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Tue, 10 Feb 2026 17:03:46 +0100 Subject: [PATCH 09/11] Don't run windows with asan in push This is slower than I anticipated --- .github/nightly_matrix.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/nightly_matrix.php b/.github/nightly_matrix.php index c0a3fadc39152..6a8e54c3d2706 100644 --- a/.github/nightly_matrix.php +++ b/.github/nightly_matrix.php @@ -124,11 +124,12 @@ function select_jobs($trigger, $labels, $php_version, $ref, $all_variations) { $jobs['PECL'] = true; } if ($all_jobs || !$no_jobs || $test_windows) { - $windows_jobs = ['include' => [['asan' => true, 'opcache' => true, 'x64' => true, 'zts' => true]]]; - if ($all_variations) { - $windows_jobs['include'][] = ['asan' => false, 'opcache' => false, 'x64' => false, 'zts' => false]; - } - $jobs['WINDOWS']['matrix'] = $windows_jobs; + $jobs['WINDOWS']['matrix'] = $all_variations + ? ['include' => [ + ['asan' => true, 'opcache' => true, 'x64' => true, 'zts' => true], + ['asan' => false, 'opcache' => false, 'x64' => false, 'zts' => false], + ]] + : ['include' => [['asan' => false, 'opcache' => true, 'x64' => true, 'zts' => true]]]; $jobs['WINDOWS']['config'] = version_compare($php_version, '8.4', '>=') ? ['vs_crt_version' => 'vs17'] : ['vs_crt_version' => 'vs16']; From 1240f09399bb013298dd2525d581b8344086b0d5 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Tue, 10 Feb 2026 18:40:53 +0100 Subject: [PATCH 10/11] Remove benchmarking entry The benchmarking job is independant for push, for now at least. --- .github/nightly_matrix.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/nightly_matrix.php b/.github/nightly_matrix.php index 6a8e54c3d2706..6dc4875ce370f 100644 --- a/.github/nightly_matrix.php +++ b/.github/nightly_matrix.php @@ -50,7 +50,6 @@ function select_jobs($trigger, $labels, $php_version, $ref, $all_variations) { $no_jobs = in_array('CI: No jobs', $labels, true); $all_jobs = in_array('CI: All jobs', $labels, true); $test_alpine = in_array('CI: Alpine', $labels, true); - $test_benchmarking = in_array('CI: Benchmarking', $labels, true); $test_community = in_array('CI: Community', $labels, true); $test_freebsd = in_array('CI: FreeBSD', $labels, true); $test_libmysqlclient = in_array('CI: libmysqlclient', $labels, true); @@ -134,9 +133,6 @@ function select_jobs($trigger, $labels, $php_version, $ref, $all_variations) { ? ['vs_crt_version' => 'vs17'] : ['vs_crt_version' => 'vs16']; } - if ($all_jobs || !$no_jobs || $test_benchmarking) { - $jobs['BENCHMARKING'] = true; - } if ($all_jobs || !$no_jobs || $test_freebsd) { $jobs['FREEBSD']['matrix'] = $all_variations && version_compare($php_version, '8.3', '>=') ? ['zts' => [true, false]] From 5f6cac444af84ec460f830a40ace6b40574ffc4a Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Fri, 13 Feb 2026 00:38:36 +0100 Subject: [PATCH 11/11] Feedback --- .github/nightly_matrix.php | 16 ++++++++++++---- .github/workflows/push.yml | 4 ++-- .github/workflows/root.yml | 4 ++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/nightly_matrix.php b/.github/nightly_matrix.php index 6dc4875ce370f..8e4e9e7606e2f 100644 --- a/.github/nightly_matrix.php +++ b/.github/nightly_matrix.php @@ -165,7 +165,15 @@ function select_jobs($trigger, $labels, $php_version, $ref, $all_variations) { $branch['config']['ubuntu_version'] = version_compare($php_version, '8.5', '>=') ? '24.04' : '22.04'; } -$f = fopen(getenv('GITHUB_OUTPUT'), 'a'); -fwrite($f, 'branches=' . json_encode($branches, JSON_UNESCAPED_SLASHES) . "\n"); -fwrite($f, 'all_variations=' . json_encode($all_variations, JSON_UNESCAPED_SLASHES) . "\n"); -fclose($f); +echo "All variations:"; +echo json_encode($all_variations, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT); +echo "\n\nBranches:\n"; +echo json_encode($branches, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT); +echo "\n"; + +if (false !== ($github_output = getenv('GITHUB_OUTPUT'))) { + $f = fopen($github_output, 'a'); + fwrite($f, 'branches=' . json_encode($branches, JSON_UNESCAPED_SLASHES) . "\n"); + fwrite($f, 'all_variations=' . json_encode($all_variations, JSON_UNESCAPED_SLASHES) . "\n"); + fclose($f); +} diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 842ed83b531ef..7f2bcf2ca9e53 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -45,14 +45,14 @@ jobs: run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.ref }}" '${{ toJSON(github.event.pull_request.labels) }}' PUSH: needs: GENERATE_MATRIX - name: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches)[0].ref }} + name: ${{ matrix.branch.ref }} uses: ./.github/workflows/nightly.yml strategy: fail-fast: false matrix: branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }} with: - all_variations: ${{ needs.GENERATE_MATRIX.outputs.all_variations == 'true' && true || false }} + all_variations: ${{ needs.GENERATE_MATRIX.outputs.all_variations == 'true' }} branch: ${{ toJSON(matrix.branch) }} secrets: inherit BENCHMARKING: diff --git a/.github/workflows/root.yml b/.github/workflows/root.yml index f1936547ca618..fff1ac3ac894a 100644 --- a/.github/workflows/root.yml +++ b/.github/workflows/root.yml @@ -31,7 +31,7 @@ jobs: nightly- - name: Generate Matrix id: set-matrix - run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.ref }}" + run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.ref }}" '[]' NIGHTLY: needs: GENERATE_MATRIX name: ${{ matrix.branch.ref }} @@ -42,6 +42,6 @@ jobs: matrix: branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }} with: - all_variations: ${{ needs.GENERATE_MATRIX.outputs.all_variations == 'true' && true || false }} + all_variations: ${{ needs.GENERATE_MATRIX.outputs.all_variations == 'true' }} branch: ${{ toJSON(matrix.branch) }} secrets: inherit