From bcbc9c2f0027cdbf29c1a8575adb37cf80e51572 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 18 Feb 2026 17:29:20 +0100 Subject: [PATCH 1/5] Rename nightly.yml to test-suite.yml --- .github/workflows/push.yml | 2 +- .github/workflows/root.yml | 2 +- .github/workflows/{nightly.yml => test-suite.yml} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{nightly.yml => test-suite.yml} (100%) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index ccd82c546d9..52f7570385d 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -46,7 +46,7 @@ jobs: PUSH: needs: GENERATE_MATRIX name: ${{ matrix.branch.ref }} - uses: ./.github/workflows/nightly.yml + uses: ./.github/workflows/test-suite.yml strategy: fail-fast: false matrix: diff --git a/.github/workflows/root.yml b/.github/workflows/root.yml index 5b3ebfd11d5..2b513a76dce 100644 --- a/.github/workflows/root.yml +++ b/.github/workflows/root.yml @@ -36,7 +36,7 @@ jobs: needs: GENERATE_MATRIX name: ${{ matrix.branch.ref }} if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} - uses: ./.github/workflows/nightly.yml + uses: ./.github/workflows/test-suite.yml strategy: fail-fast: false matrix: diff --git a/.github/workflows/nightly.yml b/.github/workflows/test-suite.yml similarity index 100% rename from .github/workflows/nightly.yml rename to .github/workflows/test-suite.yml From dca6e5efd31543905499a629741811a814419de6 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 18 Feb 2026 17:29:45 +0100 Subject: [PATCH 2/5] Rename push.yml to test.yml --- .github/workflows/{push.yml => test.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{push.yml => test.yml} (100%) diff --git a/.github/workflows/push.yml b/.github/workflows/test.yml similarity index 100% rename from .github/workflows/push.yml rename to .github/workflows/test.yml From 12148a5b494184820b26c7f142d1162e88057274 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 18 Feb 2026 17:48:53 +0100 Subject: [PATCH 3/5] Combine push.yml and root.yml into test.yml --- .github/nightly_matrix.php | 20 ++++++++-------- .github/workflows/root.yml | 47 -------------------------------------- .github/workflows/test.yml | 21 +++++++++++++++-- 3 files changed, 29 insertions(+), 59 deletions(-) delete mode 100644 .github/workflows/root.yml diff --git a/.github/nightly_matrix.php b/.github/nightly_matrix.php index 51dd2e69074..39472fda3e7 100644 --- a/.github/nightly_matrix.php +++ b/.github/nightly_matrix.php @@ -1,11 +1,11 @@ 'master', 'version' => [8, 6]], - ['ref' => 'PHP-8.5', 'version' => [8, 5]], - ['ref' => 'PHP-8.4', 'version' => [8, 4]], - ['ref' => 'PHP-8.3', 'version' => [8, 3]], - ['ref' => 'PHP-8.2', 'version' => [8, 2]], + ['ref' => 'refs/heads/master', 'version' => [8, 6]], + ['ref' => 'refs/heads/PHP-8.5', 'version' => [8, 5]], + ['ref' => 'refs/heads/PHP-8.4', 'version' => [8, 4]], + ['ref' => 'refs/heads/PHP-8.3', 'version' => [8, 3]], + ['ref' => 'refs/heads/PHP-8.2', 'version' => [8, 2]], ]; function get_branch_commit_cache_file_path(): string { @@ -81,7 +81,7 @@ function select_jobs($repository, $trigger, $nightly, $labels, $php_version, $re : ['type' => ['asan']]; $jobs['COMMUNITY']['config']['symfony_version'] = version_compare($php_version, '8.4', '>=') ? '8.1' : '7.4'; } - if (($all_jobs && $ref === 'master') || $test_coverage) { + if (($all_jobs && $ref === 'refs/heads/master') || $test_coverage) { $jobs['COVERAGE'] = true; } if ($all_jobs || $test_libmysqlclient) { @@ -129,7 +129,7 @@ function select_jobs($repository, $trigger, $nightly, $labels, $php_version, $re if ($all_jobs || $test_opcache_variation) { $jobs['OPCACHE_VARIATION'] = true; } - if (($all_jobs && $ref === 'master') || $test_pecl) { + if (($all_jobs && $ref === 'refs/heads/master') || $test_pecl) { $jobs['PECL'] = true; } if ($all_jobs || !$no_jobs || $test_windows) { @@ -160,14 +160,14 @@ $discard_cache = $sunday if ($discard_cache) { @unlink(get_branch_commit_cache_file_path()); } -$branch = $argv[3] ?? 'master'; -$branches = $branch === 'master' +$branch = $argv[3] ?? 'refs/heads/master'; +$nightly = $trigger === 'schedule' || $trigger === 'workflow_dispatch'; +$branches = $nightly && $branch === 'refs/heads/master' ? get_branches() : [['ref' => $branch, 'version' => get_current_version()]]; $labels = json_decode($argv[4] ?? '[]', true) ?? []; $labels = array_column($labels, 'name'); -$nightly = $trigger === 'schedule' || $trigger === 'workflow_dispatch'; $all_variations = $nightly || in_array('CI: All variations', $labels, true); $repository = $argv[5] ?? null; diff --git a/.github/workflows/root.yml b/.github/workflows/root.yml deleted file mode 100644 index 2b513a76dce..00000000000 --- a/.github/workflows/root.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Nightly -on: - schedule: - - cron: "0 1 * * *" - workflow_dispatch: ~ -permissions: - contents: read -jobs: - GENERATE_MATRIX: - name: Generate Matrix - 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 }} - steps: - - uses: actions/checkout@v6 - with: - # Set fetch-depth to 0 to clone the full repository - # including all branches. This is required to find - # the correct commit hashes. - fetch-depth: 0 - - name: Grab the commit mapping - uses: actions/cache@v5 - with: - path: branch-commit-cache.json - # The cache key needs to change every time for the - # cache to be updated after this job finishes. - key: nightly-${{ github.run_id }}-${{ github.run_attempt }} - restore-keys: | - 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 }}" '[]' "${{ github.repository }}" - NIGHTLY: - needs: GENERATE_MATRIX - name: ${{ matrix.branch.ref }} - if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} - uses: ./.github/workflows/test-suite.yml - strategy: - fail-fast: false - matrix: - branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }} - with: - all_variations: ${{ needs.GENERATE_MATRIX.outputs.all_variations == 'true' }} - branch: ${{ toJSON(matrix.branch) }} - secrets: inherit diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 52f7570385d..96fbd51fb53 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Push +name: Test on: push: paths-ignore: &ignore_paths @@ -21,6 +21,8 @@ on: paths-ignore: *ignore_paths branches: - '**' + schedule: + - cron: "0 1 * * *" workflow_dispatch: ~ permissions: contents: read @@ -33,13 +35,28 @@ env: jobs: GENERATE_MATRIX: name: Generate Matrix - if: github.repository == 'php/php-src' || github.event_name == 'pull_request' + if: github.repository == 'php/php-src' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest outputs: all_variations: ${{ steps.set-matrix.outputs.all_variations }} branches: ${{ steps.set-matrix.outputs.branches }} steps: - uses: actions/checkout@v6 + with: + # When running nightly, set fetch-depth to 0 to clone the full + # repository including all branches. This is required to find the + # correct commit hashes. + fetch-depth: ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && 0 || 1 }} + - name: Grab the commit mapping + if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + uses: actions/cache@v5 + with: + path: branch-commit-cache.json + # The cache key needs to change every time for the + # cache to be updated after this job finishes. + key: nightly-${{ github.run_id }}-${{ github.run_attempt }} + restore-keys: | + nightly- - name: Generate Matrix id: set-matrix run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.ref }}" '${{ toJSON(github.event.pull_request.labels) }}' "${{ github.repository }}" From cbb3ff0a5bf916528b1579ad1203b6670449fe02 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 18 Feb 2026 18:12:32 +0100 Subject: [PATCH 4/5] Improve displayed workflow_call name The ref is very long and makes things unreadable. --- .github/nightly_matrix.php | 12 ++++++------ .github/workflows/test.yml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/nightly_matrix.php b/.github/nightly_matrix.php index 39472fda3e7..161c2241a96 100644 --- a/.github/nightly_matrix.php +++ b/.github/nightly_matrix.php @@ -1,11 +1,11 @@ 'refs/heads/master', 'version' => [8, 6]], - ['ref' => 'refs/heads/PHP-8.5', 'version' => [8, 5]], - ['ref' => 'refs/heads/PHP-8.4', 'version' => [8, 4]], - ['ref' => 'refs/heads/PHP-8.3', 'version' => [8, 3]], - ['ref' => 'refs/heads/PHP-8.2', 'version' => [8, 2]], + ['name' => 'master', 'ref' => 'refs/heads/master', 'version' => [8, 6]], + ['name' => 'PHP-8.5', 'ref' => 'refs/heads/PHP-8.5', 'version' => [8, 5]], + ['name' => 'PHP-8.4', 'ref' => 'refs/heads/PHP-8.4', 'version' => [8, 4]], + ['name' => 'PHP-8.3', 'ref' => 'refs/heads/PHP-8.3', 'version' => [8, 3]], + ['name' => 'PHP-8.2', 'ref' => 'refs/heads/PHP-8.2', 'version' => [8, 2]], ]; function get_branch_commit_cache_file_path(): string { @@ -164,7 +164,7 @@ $branch = $argv[3] ?? 'refs/heads/master'; $nightly = $trigger === 'schedule' || $trigger === 'workflow_dispatch'; $branches = $nightly && $branch === 'refs/heads/master' ? get_branches() - : [['ref' => $branch, 'version' => get_current_version()]]; + : [['name' => 'Suite', 'ref' => $branch, 'version' => get_current_version()]]; $labels = json_decode($argv[4] ?? '[]', true) ?? []; $labels = array_column($labels, 'name'); diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 96fbd51fb53..e37d5407c91 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -62,7 +62,7 @@ jobs: run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.ref }}" '${{ toJSON(github.event.pull_request.labels) }}' "${{ github.repository }}" PUSH: needs: GENERATE_MATRIX - name: ${{ matrix.branch.ref }} + name: ${{ matrix.branch.name }} uses: ./.github/workflows/test-suite.yml strategy: fail-fast: false From be96ae607d72c7a0d1441b541e1408d0b1af40c9 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 18 Feb 2026 19:25:20 +0100 Subject: [PATCH 5/5] Adjust nightly-results.yml for test.yml --- .github/workflows/nightly-results.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly-results.yml b/.github/workflows/nightly-results.yml index a222582da1c..fea01e1b026 100644 --- a/.github/workflows/nightly-results.yml +++ b/.github/workflows/nightly-results.yml @@ -2,13 +2,13 @@ name: Nightly results on: workflow_run: workflows: - - Nightly + - Test types: - completed jobs: on-failure: runs-on: ubuntu-latest - if: ${{ github.repository == 'php/php-src' && github.event.workflow_run.conclusion == 'failure' }} + if: ${{ github.repository == 'php/php-src' && github.event.workflow_run.event == 'schedule' && github.event.workflow_run.conclusion == 'failure' }} steps: - run: | export DEBIAN_FRONTEND=noninteractive