Skip to content

Commit 9a62bde

Browse files
committed
Add matrix to enable ubuntu noble run
1 parent a3069e4 commit 9a62bde

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

.github/workflows/stackhpc-multinode.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,36 @@ name: Multinode
5555
type: string
5656
default: main
5757
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
5876
multinode:
5977
name: Multinode
78+
strategy:
79+
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
80+
needs:
81+
- generate-matrix
6082
uses: stackhpc/stackhpc-openstack-gh-workflows/.github/workflows/[email protected]
6183
with:
6284
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 }}
6688
neutron_plugin: ${{ inputs.neutron_plugin }}
6789
upgrade: ${{ inputs.upgrade }}
6890
break_on: ${{ inputs.break_on }}

0 commit comments

Comments
 (0)