Skip to content

Commit 7fcfaae

Browse files
committed
Merge branch 'PHP-8.2'
* PHP-8.2: Use per-branch matrix for windows nightly
2 parents ee000ea + e11b55d commit 7fcfaae

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
@@ -81,6 +81,25 @@ function get_matrix_include(array $branches) {
8181
return $jobs;
8282
}
8383

84+
function get_windows_matrix_include(array $branches) {
85+
$jobs = [];
86+
foreach ($branches as $branch) {
87+
$jobs[] = [
88+
'branch' => $branch,
89+
'x64' => true,
90+
'zts' => true,
91+
'opcache' => true,
92+
];
93+
$jobs[] = [
94+
'branch' => $branch,
95+
'x64' => false,
96+
'zts' => false,
97+
'opcache' => false,
98+
];
99+
}
100+
return $jobs;
101+
}
102+
84103
$trigger = $argv[1] ?? 'schedule';
85104
$attempt = (int) ($argv[2] ?? 1);
86105
$discard_cache = ($trigger === 'schedule' && $attempt !== 1) || $trigger === 'workflow_dispatch';
@@ -90,8 +109,10 @@ function get_matrix_include(array $branches) {
90109

91110
$branches = get_branches();
92111
$matrix_include = get_matrix_include($branches);
112+
$windows_matrix_include = get_windows_matrix_include($branches);
93113

94114
$f = fopen(getenv('GITHUB_OUTPUT'), 'a');
95115
fwrite($f, 'branches=' . json_encode($branches, JSON_UNESCAPED_SLASHES) . "\n");
96116
fwrite($f, 'matrix-include=' . json_encode($matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
117+
fwrite($f, 'windows-matrix-include=' . json_encode($windows_matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
97118
fclose($f);

.github/workflows/nightly.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
outputs:
1414
branches: ${{ steps.set-matrix.outputs.branches }}
1515
matrix-include: ${{ steps.set-matrix.outputs.matrix-include }}
16+
windows-matrix-include: ${{ steps.set-matrix.outputs.windows-matrix-include }}
1617
steps:
1718
- uses: actions/checkout@v3
1819
with:
@@ -837,17 +838,13 @@ jobs:
837838
with:
838839
token: ${{ secrets.ACTION_MONITORING_SLACK }}
839840
WINDOWS:
841+
needs: GENERATE_MATRIX
842+
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
840843
strategy:
841844
fail-fast: false
842845
matrix:
843-
include:
844-
- x64: true
845-
zts: true
846-
opcache: true
847-
- x64: false
848-
zts: false
849-
opcache: false
850-
name: "WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
846+
include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.windows-matrix-include) }}
847+
name: "${{ matrix.branch.name }}_WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
851848
runs-on: windows-2019
852849
env:
853850
PHP_BUILD_CACHE_BASE_DIR: C:\build-cache
@@ -865,6 +862,8 @@ jobs:
865862
run: git config --global core.autocrlf false && git config --global core.eol lf
866863
- name: git checkout
867864
uses: actions/checkout@v3
865+
with:
866+
ref: ${{ matrix.branch.ref }}
868867
- name: Setup
869868
uses: ./.github/actions/setup-windows
870869
- name: Build

0 commit comments

Comments
 (0)