Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 35 additions & 9 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: linux

on:
push:
branches: [main]
branches: [ main ]
pull_request:

concurrency:
Expand All @@ -12,7 +12,7 @@ concurrency:
env:
FORCE_COLOR: 1

permissions: {}
permissions: { }

jobs:
crate-build:
Expand Down Expand Up @@ -248,15 +248,41 @@ jobs:

- name: Load Docker Images
run: |
set -euo pipefail

# We need to keep the image-*.tar file since it is used as a
# Makefile dependency.
load() {
image="${1%.tar.zst}"
echo "decompressing ${image}.tar.zst"
zstd -d --rm "${image}.tar.zst"
docker load --input "${image}.tar"
}

# Avoid loading images that aren't used.
case "$(uname -m)" in
aarch64)
want_suffix=linux_aarch64.tar.zst
;;
x86_64)
want_suffix=linux_x86_64.tar.zst
;;
*)
echo "unsupported host arch: $(uname -m)"
exit 1
;;
esac

for f in build/image-*.tar.zst; do
echo "decompressing $f"
zstd -d --rm ${f}
done

for f in build/image-*.tar; do
echo "loading $f"
docker load --input $f
if [[ "$f" == *"${want_suffix}" ]]; then
load "${f}" &
else
echo "skipping ${f}"
rm "${f}"
fi
done

wait

- name: Build
if: ${{ ! matrix.dry-run }}
Expand Down
Loading