Skip to content

Commit 873095d

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: Adjust nightly-results.yml for test.yml Improve displayed workflow_call name Combine push.yml and root.yml into test.yml Rename push.yml to test.yml Rename nightly.yml to test-suite.yml
2 parents 59cb3ab + cbbe046 commit 873095d

File tree

5 files changed

+34
-64
lines changed

5 files changed

+34
-64
lines changed

.github/nightly_matrix.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

33
const BRANCHES = [
4-
['ref' => 'master', 'version' => [8, 6]],
5-
['ref' => 'PHP-8.5', 'version' => [8, 5]],
6-
['ref' => 'PHP-8.4', 'version' => [8, 4]],
7-
['ref' => 'PHP-8.3', 'version' => [8, 3]],
8-
['ref' => 'PHP-8.2', 'version' => [8, 2]],
4+
['name' => 'master', 'ref' => 'refs/heads/master', 'version' => [8, 6]],
5+
['name' => 'PHP-8.5', 'ref' => 'refs/heads/PHP-8.5', 'version' => [8, 5]],
6+
['name' => 'PHP-8.4', 'ref' => 'refs/heads/PHP-8.4', 'version' => [8, 4]],
7+
['name' => 'PHP-8.3', 'ref' => 'refs/heads/PHP-8.3', 'version' => [8, 3]],
8+
['name' => 'PHP-8.2', 'ref' => 'refs/heads/PHP-8.2', 'version' => [8, 2]],
99
];
1010

1111
function get_branch_commit_cache_file_path(): string {
@@ -81,7 +81,7 @@ function select_jobs($repository, $trigger, $nightly, $labels, $php_version, $re
8181
: ['type' => ['asan']];
8282
$jobs['COMMUNITY']['config']['symfony_version'] = version_compare($php_version, '8.4', '>=') ? '8.1' : '7.4';
8383
}
84-
if (($all_jobs && $ref === 'master') || $test_coverage) {
84+
if (($all_jobs && $ref === 'refs/heads/master') || $test_coverage) {
8585
$jobs['COVERAGE'] = true;
8686
}
8787
if ($all_jobs || $test_libmysqlclient) {
@@ -129,7 +129,7 @@ function select_jobs($repository, $trigger, $nightly, $labels, $php_version, $re
129129
if ($all_jobs || $test_opcache_variation) {
130130
$jobs['OPCACHE_VARIATION'] = true;
131131
}
132-
if (($all_jobs && $ref === 'master') || $test_pecl) {
132+
if (($all_jobs && $ref === 'refs/heads/master') || $test_pecl) {
133133
$jobs['PECL'] = true;
134134
}
135135
if ($all_jobs || !$no_jobs || $test_windows) {
@@ -160,14 +160,14 @@ function select_jobs($repository, $trigger, $nightly, $labels, $php_version, $re
160160
if ($discard_cache) {
161161
@unlink(get_branch_commit_cache_file_path());
162162
}
163-
$branch = $argv[3] ?? 'master';
164-
$branches = $branch === 'master'
163+
$branch = $argv[3] ?? 'refs/heads/master';
164+
$nightly = $trigger === 'schedule' || $trigger === 'workflow_dispatch';
165+
$branches = $nightly && $branch === 'refs/heads/master'
165166
? get_branches()
166-
: [['ref' => $branch, 'version' => get_current_version()]];
167+
: [['name' => 'Suite', 'ref' => $branch, 'version' => get_current_version()]];
167168

168169
$labels = json_decode($argv[4] ?? '[]', true) ?? [];
169170
$labels = array_column($labels, 'name');
170-
$nightly = $trigger === 'schedule' || $trigger === 'workflow_dispatch';
171171
$all_variations = $nightly || in_array('CI: All variations', $labels, true);
172172

173173
$repository = $argv[5] ?? null;

.github/workflows/nightly-results.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ name: Nightly results
22
on:
33
workflow_run:
44
workflows:
5-
- Nightly
5+
- Test
66
types:
77
- completed
88
jobs:
99
on-failure:
1010
runs-on: ubuntu-latest
11-
if: ${{ github.repository == 'php/php-src' && github.event.workflow_run.conclusion == 'failure' }}
11+
if: ${{ github.repository == 'php/php-src' && github.event.workflow_run.event == 'schedule' && github.event.workflow_run.conclusion == 'failure' }}
1212
steps:
1313
- run: |
1414
export DEBIAN_FRONTEND=noninteractive

.github/workflows/root.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.
Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Push
1+
name: Test
22
on:
33
push:
44
paths-ignore: &ignore_paths
@@ -21,6 +21,8 @@ on:
2121
paths-ignore: *ignore_paths
2222
branches:
2323
- '**'
24+
schedule:
25+
- cron: "0 1 * * *"
2426
workflow_dispatch: ~
2527
permissions:
2628
contents: read
@@ -33,20 +35,35 @@ env:
3335
jobs:
3436
GENERATE_MATRIX:
3537
name: Generate Matrix
36-
if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
38+
if: github.repository == 'php/php-src' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
3739
runs-on: ubuntu-latest
3840
outputs:
3941
all_variations: ${{ steps.set-matrix.outputs.all_variations }}
4042
branches: ${{ steps.set-matrix.outputs.branches }}
4143
steps:
4244
- uses: actions/checkout@v6
45+
with:
46+
# When running nightly, set fetch-depth to 0 to clone the full
47+
# repository including all branches. This is required to find the
48+
# correct commit hashes.
49+
fetch-depth: ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && 0 || 1 }}
50+
- name: Grab the commit mapping
51+
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
52+
uses: actions/cache@v5
53+
with:
54+
path: branch-commit-cache.json
55+
# The cache key needs to change every time for the
56+
# cache to be updated after this job finishes.
57+
key: nightly-${{ github.run_id }}-${{ github.run_attempt }}
58+
restore-keys: |
59+
nightly-
4360
- name: Generate Matrix
4461
id: set-matrix
4562
run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}" "${{ github.ref }}" '${{ toJSON(github.event.pull_request.labels) }}' "${{ github.repository }}"
4663
PUSH:
4764
needs: GENERATE_MATRIX
48-
name: ${{ matrix.branch.ref }}
49-
uses: ./.github/workflows/nightly.yml
65+
name: ${{ matrix.branch.name }}
66+
uses: ./.github/workflows/test-suite.yml
5067
strategy:
5168
fail-fast: false
5269
matrix:

0 commit comments

Comments
 (0)