Merge branch 'PHP-8.2'

* PHP-8.2:
  Use per-branch matrix for windows nightly
This commit is contained in:
Ilija Tovilo 2023-08-14 11:42:26 +02:00
commit 7fcfaae006
No known key found for this signature in database
GPG Key ID: A4F5D403F118200A
2 changed files with 28 additions and 8 deletions

View File

@ -81,6 +81,25 @@ function get_matrix_include(array $branches) {
return $jobs;
}
function get_windows_matrix_include(array $branches) {
$jobs = [];
foreach ($branches as $branch) {
$jobs[] = [
'branch' => $branch,
'x64' => true,
'zts' => true,
'opcache' => true,
];
$jobs[] = [
'branch' => $branch,
'x64' => false,
'zts' => false,
'opcache' => false,
];
}
return $jobs;
}
$trigger = $argv[1] ?? 'schedule';
$attempt = (int) ($argv[2] ?? 1);
$discard_cache = ($trigger === 'schedule' && $attempt !== 1) || $trigger === 'workflow_dispatch';
@ -90,8 +109,10 @@ if ($discard_cache) {
$branches = get_branches();
$matrix_include = get_matrix_include($branches);
$windows_matrix_include = get_windows_matrix_include($branches);
$f = fopen(getenv('GITHUB_OUTPUT'), 'a');
fwrite($f, 'branches=' . json_encode($branches, JSON_UNESCAPED_SLASHES) . "\n");
fwrite($f, 'matrix-include=' . json_encode($matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
fwrite($f, 'windows-matrix-include=' . json_encode($windows_matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
fclose($f);

View File

@ -13,6 +13,7 @@ jobs:
outputs:
branches: ${{ steps.set-matrix.outputs.branches }}
matrix-include: ${{ steps.set-matrix.outputs.matrix-include }}
windows-matrix-include: ${{ steps.set-matrix.outputs.windows-matrix-include }}
steps:
- uses: actions/checkout@v3
with:
@ -837,17 +838,13 @@ jobs:
with:
token: ${{ secrets.ACTION_MONITORING_SLACK }}
WINDOWS:
needs: GENERATE_MATRIX
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
strategy:
fail-fast: false
matrix:
include:
- x64: true
zts: true
opcache: true
- x64: false
zts: false
opcache: false
name: "WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.windows-matrix-include) }}
name: "${{ matrix.branch.name }}_WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
runs-on: windows-2019
env:
PHP_BUILD_CACHE_BASE_DIR: C:\build-cache
@ -865,6 +862,8 @@ jobs:
run: git config --global core.autocrlf false && git config --global core.eol lf
- name: git checkout
uses: actions/checkout@v3
with:
ref: ${{ matrix.branch.ref }}
- name: Setup
uses: ./.github/actions/setup-windows
- name: Build