Skip to content

Commit 1063c60

Browse files
committed
Add CI matrix generation workflow
1 parent 1a99365 commit 1063c60

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: "Generate CI matrix"
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
glpi-version:
7+
required: true
8+
type: string
9+
outputs:
10+
matrix:
11+
value: ${{ jobs.generate-ci-matrix.outputs.matrix }}
12+
13+
jobs:
14+
generate-ci-matrix:
15+
name: "Generate CI matrix"
16+
runs-on: "ubuntu-latest"
17+
outputs:
18+
matrix: ${{ steps.generate-ci-matrix.outputs.matrix }}
19+
steps:
20+
- name: "Generate CI matrix"
21+
id: "generate-ci-matrix"
22+
run: |
23+
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+
'
38+
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+
'
50+
fi
51+
echo "matrix=$(echo $MATRIX | jq -c .)" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)