@@ -3,16 +3,35 @@ name: Build OpenStack admin guide
3
3
on :
4
4
- pull_request
5
5
jobs :
6
+ # Dynamically define test matrix.
7
+ # In openstack-admin-guide CI we want to test various configurations.
8
+ # In client admin guide CI we just want to test the actual configuration.
9
+ # https://stackoverflow.com/questions/65384420/how-do-i-make-a-github-action-matrix-element-conditional
10
+ matrix :
11
+ name : Generate test matrix
12
+ runs-on : ubuntu-latest
13
+ outputs :
14
+ matrix : ${{ steps.set-matrix.outputs.matrix }}
15
+ steps :
16
+ - uses : actions/checkout@v3
17
+
18
+ - name : Generate test matrix
19
+ id : set-matrix
20
+ run : |
21
+ echo -n "matrix={\"deployment_yaml\": [\"default\"" >> $GITHUB_OUTPUT
22
+ if [[ ${{ github.repository }} == 'stackhpc/openstack-admin-guide' ]]; then
23
+ for yaml in $(ls .github/workflows/deployment_yaml/); do
24
+ echo -n ", \"$yaml\"" >> $GITHUB_OUTPUT
25
+ done
26
+ fi
27
+ echo "]}" >> $GITHUB_OUTPUT
28
+
6
29
build :
7
30
name : Build OpenStack admin guide
31
+ needs : matrix
8
32
runs-on : ubuntu-latest
9
33
strategy :
10
- matrix :
11
- deployment_yaml :
12
- - __default__
13
- - disable-ceph
14
- - enable-ironic
15
- - enable-ironic-no-cleaning-or-physnet
34
+ matrix : ${{ fromJson(needs.matrix.outputs.matrix) }}
16
35
steps :
17
36
- uses : actions/checkout@v3
18
37
24
43
run : pip3 install -r requirements.txt
25
44
26
45
- name : Copy deployment.yml into place
27
- run : cp .github/workflows/deployment_yaml/${{ matrix.deployment_yaml }}.yml source/data/deployment.yml
28
- if : matrix.deployment_yaml != '__default__ '
46
+ run : cp .github/workflows/deployment_yaml/${{ matrix.deployment_yaml }} source/data/deployment.yml
47
+ if : matrix.deployment_yaml != 'default '
29
48
30
49
- name : Build HTML
31
50
run : make html
0 commit comments