Skip to content

Commit 89abe58

Browse files
committed
ci: cache incremental wheel builds
Signed-off-by: AlpinDale <alpindale@gmail.com>
1 parent e66025e commit 89abe58

2 files changed

Lines changed: 24 additions & 7 deletions

File tree

.github/scripts/install-rclone.sh

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,41 @@
44
set -euo pipefail
55

66
install_dir="${1:?usage: install-rclone.sh INSTALL_DIR}"
7-
archive="rclone-current-linux-amd64.zip"
7+
case "$(uname -m)" in
8+
x86_64|amd64) architecture="amd64" ;;
9+
aarch64|arm64) architecture="arm64" ;;
10+
*)
11+
echo "Unsupported architecture: $(uname -m)" >&2
12+
exit 1
13+
;;
14+
esac
15+
archive="rclone-current-linux-${architecture}.zip"
816
tmp_dir="$(mktemp -d)"
917
trap 'rm -rf "$tmp_dir"' EXIT
1018

1119
curl --fail --location --retry 5 --retry-all-errors \
1220
"https://downloads.rclone.org/${archive}" \
1321
--output "${tmp_dir}/${archive}"
1422
unzip -q "${tmp_dir}/${archive}" -d "$tmp_dir"
15-
rclone_path="$(find "$tmp_dir" -type f -path '*/rclone-*/rclone' -print -quit)"
23+
rclone_path="$(find "$tmp_dir" -type f -path '*/rclone-*-linux-*/rclone' -print -quit)"
1624
version_dir="$(basename "$(dirname "$rclone_path")")"
1725
version="${version_dir#rclone-}"
18-
version="${version%-linux-amd64}"
26+
version="${version%-linux-${architecture}}"
1927

2028
curl --fail --location --retry 5 --retry-all-errors \
2129
"https://downloads.rclone.org/${version}/SHA256SUMS" \
2230
--output "${tmp_dir}/SHA256SUMS"
23-
versioned_archive="${version}-linux-amd64.zip"
31+
versioned_archive="${version_dir}.zip"
2432
expected="$(awk -v file="$versioned_archive" '$2 == file { print $1 }' "${tmp_dir}/SHA256SUMS")"
2533
actual="$(sha256sum "${tmp_dir}/${archive}" | cut -d " " -f 1)"
26-
test -n "$expected"
27-
test "$actual" = "$expected"
34+
if [[ -z "$expected" ]]; then
35+
echo "Checksum for ${versioned_archive} was not found in rclone SHA256SUMS" >&2
36+
exit 1
37+
fi
38+
if [[ "$actual" != "$expected" ]]; then
39+
echo "Checksum mismatch for ${archive}: expected ${expected}, got ${actual}" >&2
40+
exit 1
41+
fi
2842

2943
mkdir -p "$install_dir"
3044
cp "$rclone_path" "${install_dir}/rclone"

docker/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,10 @@ RUN --mount=type=cache,target=/root/.cache/uv \
315315
fi
316316

317317
# Build the Aphrodite wheel
318-
RUN --mount=type=cache,target=/root/.cache/uv \
318+
RUN --mount=type=cache,id=aphrodite-wheel-uv,target=/root/.cache/uv \
319+
--mount=type=cache,id=aphrodite-wheel-ccache,target=/root/.cache/ccache,sharing=locked \
320+
--mount=type=cache,id=aphrodite-wheel-cmake,target=/workspace/build,sharing=locked \
321+
--mount=type=cache,id=aphrodite-wheel-deps,target=/workspace/.deps,sharing=locked \
319322
--mount=type=bind,source=.git,target=.git \
320323
--mount=type=secret,id=aws-credentials,target=/root/.aws/credentials,required=false \
321324
if [ "$USE_SCCACHE" = "1" ]; then \

0 commit comments

Comments
 (0)