File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: linux
22
33on :
44 push :
5- branches : [main]
5+ branches : [ main ]
66 pull_request :
77
88concurrency :
@@ -12,7 +12,7 @@ concurrency:
1212env :
1313 FORCE_COLOR : 1
1414
15- permissions : {}
15+ permissions : { }
1616
1717jobs :
1818 crate-build :
@@ -248,15 +248,41 @@ jobs:
248248
249249 - name : Load Docker Images
250250 run : |
251+ set -euo pipefail
252+
253+ # We need to keep the image-*.tar file since it is used as a
254+ # Makefile dependency.
255+ load() {
256+ image="${1%.tar.zst}"
257+ echo "decompressing ${image}.tar.zst"
258+ zstd -d --rm "${image}.tar.zst"
259+ docker load --input "${image}.tar"
260+ }
261+
262+ # Avoid loading images that aren't used.
263+ case "$(uname -m)" in
264+ aarch64)
265+ want_suffix=linux_aarch64.tar.zst
266+ ;;
267+ x86_64)
268+ want_suffix=linux_x86_64.tar.zst
269+ ;;
270+ *)
271+ echo "unsupported host arch: $(uname -m)"
272+ exit 1
273+ ;;
274+ esac
275+
251276 for f in build/image-*.tar.zst; do
252- echo "decompressing $f"
253- zstd -d --rm ${f}
254- done
255-
256- for f in build/image-*.tar; do
257- echo "loading $f"
258- docker load --input $f
277+ if [[ "$f" == *"${want_suffix}" ]]; then
278+ load "${f}" &
279+ else
280+ echo "skipping ${f}"
281+ rm "${f}"
282+ fi
259283 done
284+
285+ wait
260286
261287 - name : Build
262288 if : ${{ ! matrix.dry-run }}
You can’t perform that action at this time.
0 commit comments