|
1 | 1 | name: Cache PHP for nightly versions
|
2 | 2 | on:
|
3 | 3 | push:
|
4 |
| - workflow_dispatch: |
5 | 4 | schedule:
|
6 | 5 | - cron: '0 4 1-31/2 * *'
|
| 6 | + workflow_dispatch: |
| 7 | + inputs: |
| 8 | + php-versions: |
| 9 | + description: 'PHP version to build' |
| 10 | + default: '8.5' |
| 11 | + required: false |
| 12 | + builds: |
| 13 | + description: 'Build type' |
| 14 | + default: 'debug release' |
| 15 | + required: false |
| 16 | + ts: |
| 17 | + description: 'Type safety' |
| 18 | + default: 'nts zts' |
| 19 | + required: false |
| 20 | + containers: |
| 21 | + description: 'OS containers' |
| 22 | + default: 'ubuntu:24.04 ubuntu:22.04 ubuntu:20.04 arm64v8/ubuntu:22.04 arm64v8/ubuntu:24.04' |
| 23 | + required: false |
| 24 | + |
| 25 | +env: |
| 26 | + PHP_VERSIONS: '8.5' |
| 27 | + BUILDS: 'debug release' |
| 28 | + TS: 'nts zts' |
| 29 | + CONTAINERS: 'ubuntu:24.04 ubuntu:22.04 ubuntu:20.04 arm64v8/ubuntu:22.04 arm64v8/ubuntu:24.04' |
| 30 | + BASE_OS: ubuntu-24.04 |
| 31 | + BASE_OS_ARM: ubuntu-24.04-arm |
| 32 | + |
7 | 33 | jobs:
|
8 |
| - cache: |
9 |
| - container: ubuntu:${{ matrix.container }} |
| 34 | + get-matrix: |
10 | 35 | runs-on: ubuntu-latest
|
| 36 | + outputs: |
| 37 | + matrix: ${{ steps.get-matrix.outputs.matrix }} |
| 38 | + steps: |
| 39 | + - name: Checkout |
| 40 | + uses: actions/checkout@v4 |
| 41 | + |
| 42 | + - name: Get Matrix |
| 43 | + id: get-matrix |
| 44 | + run: bash scripts/get-matrix.sh |
| 45 | + env: |
| 46 | + PHP_VERSIONS: ${{ inputs.php-versions || env.PHP_VERSIONS }} |
| 47 | + BUILDS: ${{ inputs.builds || env.BUILDS }} |
| 48 | + TS: ${{ inputs.ts || env.TS }} |
| 49 | + CONTAINERS: ${{ inputs.containers || env.CONTAINERS }} |
| 50 | + BASE_OS: ${{ env.BASE_OS }} |
| 51 | + BASE_OS_ARM: ${{ env.BASE_OS_ARM }} |
| 52 | + cache: |
| 53 | + needs: get-matrix |
| 54 | + container: ${{ matrix.container }} |
| 55 | + runs-on: ${{ matrix.container-base }} |
11 | 56 | strategy:
|
12 | 57 | fail-fast: false
|
13 |
| - matrix: |
14 |
| - container: [24.04, 22.04, 20.04] |
15 |
| - php-versions: ['8.5'] |
16 |
| - builds: ['debug', 'release'] |
17 |
| - ts: [zts, nts] |
| 58 | + matrix: ${{fromJson(needs.get-matrix.outputs.matrix)}} |
18 | 59 | if: "!contains(github.event.head_commit.message, 'skip-nightly-cache')"
|
19 | 60 | steps:
|
20 | 61 | - name: Checkout
|
@@ -63,18 +104,14 @@ jobs:
|
63 | 104 | - name: Upload Artifact
|
64 | 105 | uses: actions/upload-artifact@v4
|
65 | 106 | with:
|
66 |
| - name: ubuntu-${{ matrix.container }}-${{ matrix.php-versions }}-${{ matrix.builds }}-${{ matrix.ts }} |
| 107 | + name: ${{ matrix.os }}-${{ matrix.php-versions }}-${{ matrix.builds }}-${{ matrix.ts }} |
67 | 108 | path: builds
|
68 | 109 | tests:
|
69 | 110 | runs-on: ${{ matrix.os }}
|
70 |
| - needs: cache |
| 111 | + needs: [get-matrix, cache] |
71 | 112 | strategy:
|
72 | 113 | fail-fast: false
|
73 |
| - matrix: |
74 |
| - os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04] |
75 |
| - php-versions: ['8.5'] |
76 |
| - builds: ['debug', 'release'] |
77 |
| - ts: [nts, zts] |
| 114 | + matrix: ${{fromJson(needs.get-matrix.outputs.matrix)}} |
78 | 115 | if: "!contains(github.event.head_commit.message, 'skip-tests')"
|
79 | 116 | steps:
|
80 | 117 | - name: Checkout
|
@@ -121,7 +158,7 @@ jobs:
|
121 | 158 | run: sudo apt-get check
|
122 | 159 | release:
|
123 | 160 | runs-on: ubuntu-latest
|
124 |
| - needs: [cache, tests] |
| 161 | + needs: [get-matrix, cache, tests] |
125 | 162 | if: "!contains(github.event.head_commit.message, 'skip-release')"
|
126 | 163 | steps:
|
127 | 164 | - name: Checkout
|
|
0 commit comments