|
14 | 14 | required: false |
15 | 15 |
|
16 | 16 | jobs: |
| 17 | + resolve-runner: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + outputs: |
| 20 | + runner: ${{ steps.resolve.outputs.runner }} |
| 21 | + steps: |
| 22 | + - name: Checkout PHP source |
| 23 | + uses: actions/checkout@v6 |
| 24 | + with: |
| 25 | + repository: ${{ inputs.php-src-repository }} |
| 26 | + ref: ${{ inputs.php-src-ref }} |
| 27 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 28 | + path: php-src |
| 29 | + fetch-depth: 1 |
| 30 | + sparse-checkout: main/php_version.h |
| 31 | + sparse-checkout-cone-mode: false |
| 32 | + |
| 33 | + - name: Resolve runner |
| 34 | + id: resolve |
| 35 | + shell: bash |
| 36 | + run: | |
| 37 | + read -r major minor < <(awk '/^#define PHP_(MAJOR|MINOR)_VERSION/ { v[++i]=$3 } END { print v[1], v[2] }' php-src/main/php_version.h) |
| 38 | + runner="$([ "$major" -gt 8 ] || { [ "$major" -eq 8 ] && [ "$minor" -ge 6 ]; } && echo windows-2025-vs2026 || echo windows-2022)" |
| 39 | + echo "PHP source version: $major.$minor; runner: $runner" |
| 40 | + echo "runner=$runner" >> "$GITHUB_OUTPUT" |
| 41 | +
|
17 | 42 | php: |
| 43 | + needs: resolve-runner |
18 | 44 | strategy: |
19 | 45 | matrix: |
20 | 46 | arch: [x64, x86] |
21 | 47 | ts: [nts, ts] |
22 | | - runs-on: ${{ (contains(inputs.php-src-ref, 'master') || contains(inputs.php-src-ref, '8.6')) && 'windows-2025-vs2026' || 'windows-2022' }} |
| 48 | + runs-on: ${{ needs.resolve-runner.outputs.runner }} |
23 | 49 | steps: |
24 | 50 | - name: Configure PHP source line endings |
25 | 51 | shell: pwsh |
@@ -63,14 +89,14 @@ jobs: |
63 | 89 | delete-merged: true |
64 | 90 |
|
65 | 91 | tests: |
66 | | - needs: artifacts |
| 92 | + needs: [resolve-runner, artifacts] |
67 | 93 | strategy: |
68 | 94 | matrix: |
69 | 95 | arch: [x64, x86] |
70 | 96 | ts: [nts, ts] |
71 | 97 | opcache: [opcache, nocache] |
72 | 98 | test-type: [php, ext] |
73 | | - runs-on: ${{ (contains(inputs.php-src-ref, 'master') || contains(inputs.php-src-ref, '8.6')) && 'windows-2025-vs2026' || 'windows-2022' }} |
| 99 | + runs-on: ${{ needs.resolve-runner.outputs.runner }} |
74 | 100 | steps: |
75 | 101 | - name: Checkout |
76 | 102 | uses: actions/checkout@v6 |
@@ -138,8 +164,8 @@ jobs: |
138 | 164 | matrix: |
139 | 165 | arch: [x64, x86] |
140 | 166 | ts: [nts, ts] |
141 | | - runs-on: ${{ (contains(inputs.php-src-ref, 'master') || contains(inputs.php-src-ref, '8.6')) && 'windows-2025-vs2026' || 'windows-2022' }} |
142 | | - needs: [artifacts] |
| 167 | + runs-on: ${{ needs.resolve-runner.outputs.runner }} |
| 168 | + needs: [resolve-runner, artifacts] |
143 | 169 | steps: |
144 | 170 | - name: Checkout |
145 | 171 | uses: actions/checkout@v6 |
|
0 commit comments