diff --git a/.github/nightly_matrix.php b/.github/nightly_matrix.php index 4a8dd1648fc..e74508785e2 100644 --- a/.github/nightly_matrix.php +++ b/.github/nightly_matrix.php @@ -78,6 +78,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'; @@ -87,6 +106,8 @@ if ($discard_cache) { $branches = get_branches(); $matrix_include = get_matrix_include($branches); +$windows_matrix_include = get_windows_matrix_include($branches); echo '::set-output name=branches::' . json_encode($branches, JSON_UNESCAPED_SLASHES) . "\n"; echo '::set-output name=matrix-include::' . json_encode($matrix_include, JSON_UNESCAPED_SLASHES) . "\n"; +echo '::set-output name=windows-matrix-include::' . json_encode($windows_matrix_include, JSON_UNESCAPED_SLASHES) . "\n"; diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 3f4f58f5407..83fe2925916 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -11,6 +11,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: @@ -655,17 +656,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 @@ -683,6 +680,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