|
6 | 6 | version: |
7 | 7 | required: true |
8 | 8 | type: string |
| 9 | + matrix: |
| 10 | + required: true |
| 11 | + type: string |
9 | 12 |
|
10 | 13 | jobs: |
| 14 | + filter: |
| 15 | + name: Filter Matrix |
| 16 | + runs-on: ubuntu-latest |
| 17 | + outputs: |
| 18 | + matrix: ${{ steps.filter.outputs.matrix }} |
| 19 | + steps: |
| 20 | + - name: Filter incompatible combinations |
| 21 | + id: filter |
| 22 | + env: |
| 23 | + MATRIX: ${{ inputs.matrix }} |
| 24 | + VERSION: ${{ inputs.version }} |
| 25 | + run: | |
| 26 | + IFS='.' read -r major minor <<< "$VERSION" |
| 27 | + # Laravel 11.x requires MariaDB 10.10+ |
| 28 | + if [[ $major -eq 10 && $minor -lt 10 ]]; then |
| 29 | + echo "matrix=$(echo "$MATRIX" | jq -c '[.[] | select(.laravel != "11.*")]')" >> "$GITHUB_OUTPUT" |
| 30 | + else |
| 31 | + echo "matrix=$(echo "$MATRIX" | jq -c .)" >> "$GITHUB_OUTPUT" |
| 32 | + fi |
| 33 | +
|
11 | 34 | test: |
12 | 35 | name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} |
| 36 | + needs: filter |
13 | 37 |
|
14 | 38 | runs-on: ubuntu-latest |
15 | 39 | strategy: |
16 | 40 | fail-fast: false |
17 | 41 | matrix: |
18 | | - version: ["${{ inputs.version }}"] |
19 | | - php: [8.1, 8.2, 8.3, 8.4] |
20 | | - laravel: [10.*, 11.*, 12.*] |
21 | | - stability: [prefer-lowest, prefer-stable] |
22 | | - exclude: |
23 | | - # Laravel 12.x only supports PHP ^8.2 |
24 | | - - laravel: 12.* |
25 | | - php: 8.1 |
26 | | - # Laravel 11.x only supports PHP ^8.2 |
27 | | - - laravel: 11.* |
28 | | - php: 8.1 |
29 | | - # Laravel 11.x required MariaDB 10.10+ |
30 | | - - laravel: 11.* |
31 | | - version: 10.3 |
32 | | - - laravel: 11.* |
33 | | - version: 10.4 |
34 | | - - laravel: 11.* |
35 | | - version: 10.5 |
36 | | - - laravel: 11.* |
37 | | - version: 10.6 |
38 | | - - laravel: 11.* |
39 | | - version: 10.7 |
40 | | - - laravel: 11.* |
41 | | - version: 10.8 |
42 | | - - laravel: 11.* |
43 | | - version: 10.9 |
| 42 | + include: ${{ fromJSON(needs.filter.outputs.matrix) }} |
44 | 43 |
|
45 | 44 | services: |
46 | 45 | database: |
47 | | - image: mariadb:${{ matrix.version }} |
| 46 | + image: mariadb:${{ inputs.version }} |
48 | 47 | options: --health-cmd="healthcheck.sh --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3 |
49 | 48 | env: |
50 | 49 | MYSQL_ALLOW_EMPTY_PASSWORD: yes |
|
53 | 52 |
|
54 | 53 | steps: |
55 | 54 | - name: Checkout code |
56 | | - uses: actions/checkout@v3 |
| 55 | + uses: actions/checkout@v4 |
57 | 56 |
|
58 | 57 | - name: Setup PHP |
59 | 58 | uses: shivammathur/setup-php@v2 |
|
0 commit comments