Skip to content

Commit e11b55d

Browse files
committed
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1: Use per-branch matrix for windows nightly
2 parents 7a4b213 + 902d39d commit e11b55d

File tree

2 files changed

+28
-8
lines changed

2 files changed

+28
-8
lines changed

.github/nightly_matrix.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,25 @@ function get_matrix_include(array $branches) {
7878
return $jobs;
7979
}
8080

81+
function get_windows_matrix_include(array $branches) {
82+
$jobs = [];
83+
foreach ($branches as $branch) {
84+
$jobs[] = [
85+
'branch' => $branch,
86+
'x64' => true,
87+
'zts' => true,
88+
'opcache' => true,
89+
];
90+
$jobs[] = [
91+
'branch' => $branch,
92+
'x64' => false,
93+
'zts' => false,
94+
'opcache' => false,
95+
];
96+
}
97+
return $jobs;
98+
}
99+
81100
$trigger = $argv[1] ?? 'schedule';
82101
$attempt = (int) ($argv[2] ?? 1);
83102
$discard_cache = ($trigger === 'schedule' && $attempt !== 1) || $trigger === 'workflow_dispatch';
@@ -87,6 +106,8 @@ function get_matrix_include(array $branches) {
87106

88107
$branches = get_branches();
89108
$matrix_include = get_matrix_include($branches);
109+
$windows_matrix_include = get_windows_matrix_include($branches);
90110

91111
echo '::set-output name=branches::' . json_encode($branches, JSON_UNESCAPED_SLASHES) . "\n";
92112
echo '::set-output name=matrix-include::' . json_encode($matrix_include, JSON_UNESCAPED_SLASHES) . "\n";
113+
echo '::set-output name=windows-matrix-include::' . json_encode($windows_matrix_include, JSON_UNESCAPED_SLASHES) . "\n";

.github/workflows/nightly.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
outputs:
1212
branches: ${{ steps.set-matrix.outputs.branches }}
1313
matrix-include: ${{ steps.set-matrix.outputs.matrix-include }}
14+
windows-matrix-include: ${{ steps.set-matrix.outputs.windows-matrix-include }}
1415
steps:
1516
- uses: actions/checkout@v3
1617
with:
@@ -655,17 +656,13 @@ jobs:
655656
with:
656657
token: ${{ secrets.ACTION_MONITORING_SLACK }}
657658
WINDOWS:
659+
needs: GENERATE_MATRIX
660+
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
658661
strategy:
659662
fail-fast: false
660663
matrix:
661-
include:
662-
- x64: true
663-
zts: true
664-
opcache: true
665-
- x64: false
666-
zts: false
667-
opcache: false
668-
name: "WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
664+
include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.windows-matrix-include) }}
665+
name: "${{ matrix.branch.name }}_WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
669666
runs-on: windows-2019
670667
env:
671668
PHP_BUILD_CACHE_BASE_DIR: C:\build-cache
@@ -683,6 +680,8 @@ jobs:
683680
run: git config --global core.autocrlf false && git config --global core.eol lf
684681
- name: git checkout
685682
uses: actions/checkout@v3
683+
with:
684+
ref: ${{ matrix.branch.ref }}
686685
- name: Setup
687686
uses: ./.github/actions/setup-windows
688687
- name: Build

0 commit comments

Comments
 (0)