11# Builds project on qemu with custom hmat settings
22name : Qemu
33
4- on : workflow_call
4+ on :
5+ workflow_call :
6+ inputs :
7+ short_run :
8+ description : Should the workflow run only basic tests?
9+ type : boolean
10+ default : false
11+ os :
12+ description : List of OSes
13+ type : string
14+ default : ' ["ubuntu-23.04"]'
515
616permissions :
717 contents : read
818
919jobs :
1020 qemu-build :
1121 name : Qemu
22+ strategy :
23+ matrix :
24+ os : ${{ fromJson(inputs.os) }}
25+
26+ # Host QEMU on any Linux platform
1227 runs-on : ubuntu-22.04
1328
1429 steps :
@@ -79,11 +94,29 @@ jobs:
7994
8095 sudo -Sk genisoimage -output ubuntu-cloud-init.iso -volid cidata -joliet -rock ./user-data ./meta-data
8196
82- - name : Download ubuntu image
83- run : wget https://cloud-images.ubuntu.com/releases/lunar/release/ubuntu-23.04-server-cloudimg-amd64.img
97+ - name : Set vars if short run
98+ if : ${{ inputs.short_run == true }}
99+ run : |
100+ echo "SHORT_RUN=true" >> $GITHUB_ENV
101+ declare -a short_configs=("default.xml" "sock_2_var3.xml" "sock_4_var1_hmat.xml")
102+ echo "CONFIG_OPTIONS=${short_configs[@]}" >> $GITHUB_ENV
103+ echo "OS_FULL_NAME=${{matrix.os}}" >> $GITHUB_ENV
104+ echo "OS_VER=$(echo ${{matrix.os}} | cut -d'-' -f2)" >> $GITHUB_ENV
105+
106+ - name : Set vars if long run
107+ if : ${{ inputs.short_run == false }}
108+ run : |
109+ echo "SHORT_RUN=false" >> $GITHUB_ENV
110+ echo "CONFIG_OPTIONS=umf/scripts/qemu/configs/*.xml" >> $GITHUB_ENV
111+ echo "OS_FULL_NAME=${{matrix.os}}" >> $GITHUB_ENV
112+ echo "OS_VER=$(echo ${{matrix.os}} | cut -d'-' -f2)" >> $GITHUB_ENV
113+
114+ - name : Download Ubuntu image
115+ run : |
116+ wget https://cloud-images.ubuntu.com/releases/${OS_VER}/release/${OS_FULL_NAME}-server-cloudimg-amd64.img -O qemu_image.img
84117
85118 - name : Resize image
86- run : qemu-img resize ./ubuntu-23.04-server-cloudimg-amd64 .img +4G
119+ run : qemu-img resize ./qemu_image .img +4G
87120
88121 - name : Build UMF in QEMU
89122 run : |
98131
99132 - name : Run tests in QEMU
100133 run : |
101- for config_file in umf/scripts/qemu/configs/*.xml; do
134+ echo "Running tests for: ${CONFIG_OPTIONS}"
135+
136+ for config_file in ${CONFIG_OPTIONS}; do
102137 config_name=$(basename $config_file)
103138
104139 while ps -aux | grep qemu-system-x86_64 | grep -q -v grep; do
@@ -117,5 +152,5 @@ jobs:
117152
118153 - uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
119154 with :
120- name : exports-coverage-qemu-all
155+ name : exports-coverage-qemu-short-${{matrix.os}}
121156 path : coverage
0 commit comments