@@ -55,14 +55,36 @@ name: Multinode
55
55
type : string
56
56
default : main
57
57
jobs :
58
+ # Dynamically define job matrix.
59
+ # We need a separate matrix entry for each distribution, when the relevant input is true.
60
+ # https://stackoverflow.com/questions/65384420/how-do-i-make-a-github-action-matrix-element-conditional
61
+ generate-matrix :
62
+ runs-on : ubuntu-latest
63
+ outputs :
64
+ matrix : ${{ steps.set-matrix.outputs.matrix }}
65
+ steps :
66
+ - name : Generate build matrix
67
+ id : set-matrix
68
+ run : |
69
+ if [[ ${{ inputs.os_distribution == 'rocky' }} ]]; then
70
+ echo "matrix={\"distro\": \"rocky\", \"release\": \"9\", \"ssh_user\": \"cloud-user\"}" >> $GITHUB_OUTPUT
71
+ elif [[ ${{ inputs.os_distribution == 'ubuntu-jammy' }} ]]; then
72
+ echo "matrix={\"distro\": \"ubuntu\", \"release\": \"jammy\", \"ssh_user\": \"ubuntu\"}" >> $GITHUB_OUTPUT
73
+ else
74
+ echo "matrix={\"distro\": \"ubuntu\", \"release\": \"noble\", \"ssh_user\": \"ubuntu\"}" >> $GITHUB_OUTPUT
75
+ fi
58
76
multinode :
59
77
name : Multinode
78
+ strategy :
79
+ matrix : ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
80
+ needs :
81
+ - generate-matrix
60
82
uses :
stackhpc/stackhpc-openstack-gh-workflows/.github/workflows/[email protected]
61
83
with :
62
84
multinode_name : ${{ inputs.multinode_name }}
63
- os_distribution : ${{ inputs.os_distribution }}
64
- os_release : ${{ inputs.os_distribution == 'rocky' && '9' || 'jammy' }}
65
- ssh_username : ${{ inputs.os_distribution == 'rocky' && 'cloud-user' || 'ubuntu' }}
85
+ os_distribution : ${{ matrix.distro }}
86
+ os_release : ${{ matrix.release }}
87
+ ssh_username : ${{ matrix.ssh_user }}
66
88
neutron_plugin : ${{ inputs.neutron_plugin }}
67
89
upgrade : ${{ inputs.upgrade }}
68
90
break_on : ${{ inputs.break_on }}
0 commit comments