11name : Build guest artifacts
22description : Cache or build the pinned Linux kernel and guest images
33
4+ inputs :
5+ restore-only :
6+ description : >-
7+ Only restore cached artifacts; skip Docker builds, determinism checks,
8+ and cache saves for artifacts that miss the cache
9+ required : false
10+ default : " false"
11+
412outputs :
513 kernel-cache-key :
614 description : Exact cache key for the Linux kernel artifacts
@@ -117,7 +125,7 @@ runs:
117125 enableCrossOsArchive : true
118126
119127 - name : Build Linux kernel (Docker)
120- if : steps.cache-linux-kernel-zstd.outputs.cache-hit != 'true'
128+ if : inputs.restore-only != 'true' && steps.cache-linux-kernel-zstd.outputs.cache-hit != 'true'
121129 shell : bash
122130 run : >-
123131 docker build
@@ -127,7 +135,7 @@ runs:
127135 .
128136
129137 - name : Save Linux kernel (zstd)
130- if : steps.cache-linux-kernel-zstd.outputs.cache-hit != 'true'
138+ if : inputs.restore-only != 'true' && steps.cache-linux-kernel-zstd.outputs.cache-hit != 'true'
131139 uses : actions/cache/save@v5
132140 with :
133141 path : |
@@ -138,7 +146,7 @@ runs:
138146 enableCrossOsArchive : true
139147
140148 - name : Build Alpine disk image (Docker)
141- if : steps.cache-alpine-image-zstd.outputs.cache-hit != 'true'
149+ if : inputs.restore-only != 'true' && steps.cache-alpine-image-zstd.outputs.cache-hit != 'true'
142150 shell : bash
143151 run : >-
144152 docker build
@@ -148,7 +156,7 @@ runs:
148156 .
149157
150158 - name : Save Alpine disk image (zstd)
151- if : steps.cache-alpine-image-zstd.outputs.cache-hit != 'true'
159+ if : inputs.restore-only != 'true' && steps.cache-alpine-image-zstd.outputs.cache-hit != 'true'
152160 uses : actions/cache/save@v5
153161 with :
154162 path : |
@@ -159,7 +167,7 @@ runs:
159167 enableCrossOsArchive : true
160168
161169 - name : Build Ubuntu initramfs (Docker)
162- if : steps.cache-ubuntu-initramfs-zstd.outputs.cache-hit != 'true'
170+ if : inputs.restore-only != 'true' && steps.cache-ubuntu-initramfs-zstd.outputs.cache-hit != 'true'
163171 shell : bash
164172 run : >-
165173 docker build
@@ -170,8 +178,11 @@ runs:
170178
171179 - name : Verify Ubuntu artifact determinism (Docker)
172180 if : >-
173- steps.cache-ubuntu-initramfs-zstd.outputs.cache-hit != 'true' ||
174- steps.cache-ubuntu-distro-zstd.outputs.cache-hit != 'true'
181+ inputs.restore-only != 'true' &&
182+ (
183+ steps.cache-ubuntu-initramfs-zstd.outputs.cache-hit != 'true' ||
184+ steps.cache-ubuntu-distro-zstd.outputs.cache-hit != 'true'
185+ )
175186 shell : bash
176187 run : >-
177188 docker build
@@ -180,7 +191,7 @@ runs:
180191 .
181192
182193 - name : Save Ubuntu initramfs (zstd)
183- if : steps.cache-ubuntu-initramfs-zstd.outputs.cache-hit != 'true'
194+ if : inputs.restore-only != 'true' && steps.cache-ubuntu-initramfs-zstd.outputs.cache-hit != 'true'
184195 uses : actions/cache/save@v5
185196 with :
186197 path : |
@@ -190,7 +201,7 @@ runs:
190201 enableCrossOsArchive : true
191202
192203 - name : Build Azure Linux initramfs (Docker)
193- if : steps.cache-azurelinux-initramfs-zstd.outputs.cache-hit != 'true'
204+ if : inputs.restore-only != 'true' && steps.cache-azurelinux-initramfs-zstd.outputs.cache-hit != 'true'
194205 shell : bash
195206 env :
196207 AZURELINUX_IMAGE : ${{ steps.guest-versions.outputs.azurelinux-image }}
@@ -205,7 +216,7 @@ runs:
205216 .
206217
207218 - name : Save Azure Linux initramfs (zstd)
208- if : steps.cache-azurelinux-initramfs-zstd.outputs.cache-hit != 'true'
219+ if : inputs.restore-only != 'true' && steps.cache-azurelinux-initramfs-zstd.outputs.cache-hit != 'true'
209220 uses : actions/cache/save@v5
210221 with :
211222 path : |
@@ -215,7 +226,7 @@ runs:
215226 enableCrossOsArchive : true
216227
217228 - name : Build Ubuntu distro layer (Docker)
218- if : steps.cache-ubuntu-distro-zstd.outputs.cache-hit != 'true'
229+ if : inputs.restore-only != 'true' && steps.cache-ubuntu-distro-zstd.outputs.cache-hit != 'true'
219230 shell : bash
220231 run : >-
221232 docker build
@@ -225,7 +236,7 @@ runs:
225236 .
226237
227238 - name : Save Ubuntu distro layer (zstd)
228- if : steps.cache-ubuntu-distro-zstd.outputs.cache-hit != 'true'
239+ if : inputs.restore-only != 'true' && steps.cache-ubuntu-distro-zstd.outputs.cache-hit != 'true'
229240 uses : actions/cache/save@v5
230241 with :
231242 path : |
@@ -238,6 +249,7 @@ runs:
238249 shell : bash
239250 run : |
240251 set -euo pipefail
252+ mkdir -p build
241253 rm -f build/ubuntu-smoke-scratch.ext4
242254 truncate --size 64M build/ubuntu-smoke-scratch.ext4
243255 mkfs.ext4 -q -F -m 0 \
0 commit comments