Skip to content

Commit 52b5924

Browse files
committed
Limit default CI matrix to min/max PHP/MariaDB versions
1 parent ccb175e commit 52b5924

File tree

2 files changed

+57
-28
lines changed

2 files changed

+57
-28
lines changed

Diff for: .github/workflows/generate-ci-matrix.yml

+51-25
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
glpi-version:
77
required: true
88
type: string
9+
complete-matrix:
10+
required: false
11+
type: boolean
12+
default: false
913
outputs:
1014
matrix:
1115
value: ${{ jobs.generate-ci-matrix.outputs.matrix }}
@@ -21,31 +25,53 @@ jobs:
2125
id: "generate-ci-matrix"
2226
run: |
2327
if [[ "${{ inputs.glpi-version }}" = "10.0.x" ]]; then
24-
MATRIX='
25-
{
26-
"include": [
27-
{"glpi-version": "10.0.x", "php-version": "7.4", "db-image": "mysql:8.0"},
28-
{"glpi-version": "10.0.x", "php-version": "8.0", "db-image": "mysql:8.0"},
29-
{"glpi-version": "10.0.x", "php-version": "8.1", "db-image": "mysql:8.0"},
30-
{"glpi-version": "10.0.x", "php-version": "8.2", "db-image": "mysql:8.0"},
31-
{"glpi-version": "10.0.x", "php-version": "8.3", "db-image": "mysql:8.0"},
32-
{"glpi-version": "10.0.x", "php-version": "8.3", "db-image": "mysql:5.7"},
33-
{"glpi-version": "10.0.x", "php-version": "8.3", "db-image": "mariadb:10.2"},
34-
{"glpi-version": "10.0.x", "php-version": "8.3", "db-image": "mariadb:10.11"}
35-
]
36-
}
37-
'
28+
if [[ "${{ inputs.complete-matrix && 'true' || 'false' }}" = "true" ]]; then
29+
MATRIX='
30+
{
31+
"include": [
32+
{"glpi-version": "10.0.x", "php-version": "7.4", "db-image": "mysql:8.0"},
33+
{"glpi-version": "10.0.x", "php-version": "8.0", "db-image": "mysql:8.0"},
34+
{"glpi-version": "10.0.x", "php-version": "8.1", "db-image": "mysql:8.0"},
35+
{"glpi-version": "10.0.x", "php-version": "8.2", "db-image": "mysql:8.0"},
36+
{"glpi-version": "10.0.x", "php-version": "8.3", "db-image": "mysql:8.0"},
37+
{"glpi-version": "10.0.x", "php-version": "8.3", "db-image": "mysql:5.7"},
38+
{"glpi-version": "10.0.x", "php-version": "8.3", "db-image": "mariadb:10.2"},
39+
{"glpi-version": "10.0.x", "php-version": "8.3", "db-image": "mariadb:10.11"}
40+
]
41+
}
42+
'
43+
else
44+
MATRIX='
45+
{
46+
"include": [
47+
{"glpi-version": "10.0.x", "php-version": "7.4", "db-image": "mariadb:10.2"},
48+
{"glpi-version": "10.0.x", "php-version": "8.3", "db-image": "mariadb:10.11"}
49+
]
50+
}
51+
'
52+
fi
3853
elif [[ "${{ inputs.glpi-version }}" = "10.1.x" ]]; then
39-
MATRIX='
40-
{
41-
"include": [
42-
{"glpi-version": "10.1.x", "php-version": "8.1", "db-image": "mysql:8.0"},
43-
{"glpi-version": "10.1.x", "php-version": "8.2", "db-image": "mysql:8.0"},
44-
{"glpi-version": "10.1.x", "php-version": "8.3", "db-image": "mysql:8.0"},
45-
{"glpi-version": "10.1.x", "php-version": "8.3", "db-image": "mariadb:10.5"},
46-
{"glpi-version": "10.1.x", "php-version": "8.3", "db-image": "mariadb:10.11"}
47-
]
48-
}
49-
'
54+
if [[ "${{ inputs.complete-matrix && 'true' || 'false' }}" = "true" ]]; then
55+
MATRIX='
56+
{
57+
"include": [
58+
{"glpi-version": "10.1.x", "php-version": "8.1", "db-image": "mysql:8.0"},
59+
{"glpi-version": "10.1.x", "php-version": "8.2", "db-image": "mysql:8.0"},
60+
{"glpi-version": "10.1.x", "php-version": "8.3", "db-image": "mysql:8.0"},
61+
{"glpi-version": "10.1.x", "php-version": "8.3", "db-image": "mariadb:10.5"},
62+
{"glpi-version": "10.1.x", "php-version": "8.3", "db-image": "mariadb:10.11"}
63+
]
64+
}
65+
'
66+
else
67+
MATRIX='
68+
{
69+
"include": [
70+
{"glpi-version": "10.0.x", "php-version": "8.1", "db-image": "mariadb:10.5"},
71+
{"glpi-version": "10.0.x", "php-version": "8.3", "db-image": "mariadb:10.11"}
72+
]
73+
}
74+
'
75+
fi
5076
fi
5177
echo "matrix=$(echo $MATRIX | jq -c .)" >> $GITHUB_OUTPUT

Diff for: README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ The `db-image` parameter is a combination of the DB server engine (`mysql`, `mar
4848

4949
## Generate CI matrix
5050

51-
This workflow can be used to generate a matrix that contains all the PHP/SQL versions that are supported by the target GLPI version.
52-
You can use it in combination with the `Continuous Integration` workflow to execute the continuous integration
53-
test suite on all PHP/SQL versions supported by the target version of GLPI, as shown in the example below.
51+
This workflow can be used to generate a matrix that contains the default PHP/SQL versions that are supported by the target GLPI version.
52+
You can use it in combination with the `Continuous Integration` workflow, as shown in the example below.
5453

5554
```yaml
5655
name: "Continuous integration"
@@ -76,6 +75,10 @@ jobs:
7675
uses: "glpi-project/plugin-ci-workflows/.github/workflows/generate-ci-matrix.yml@v1"
7776
with:
7877
glpi-version: "10.0.x"
78+
79+
# Whether the complete compatibility matrix should be generated.
80+
# Default: false
81+
complete-matrix: true
7982
ci:
8083
name: "GLPI ${{ matrix.glpi-version }} - php:${{ matrix.php-version }} - ${{ matrix.db-image }}"
8184
needs: "generate-ci-matrix"

0 commit comments

Comments
 (0)