CI: add retries and package caching across all platforms

- Add retry loops to all package manager commands (apt, apk, pacman,
pkg).
- Implement daily package caching to minimize external server hits.
- Enable Docker layer caching in CI using buildx and GHA backend.
  - Sync CI Docker build steps with the build-with-docker.sh logic.
  - We don't, or more accurately, can't actually use
`build-with-docker.sh` anymore in CI. Maybe we should move it to
scripts/tools/ to keep the root directory clean.
- add ramdisk for BSD, shave 30/60 seconds.
- change BDSs to cross-platform-actions/action for a cleaner ci and skip
SLOW_TESTS for BSDs: this shaves a few seconds
- set global CACHE_INVALIDATION_SEED
This commit is contained in:
Manuel Barrio Linares
2026-02-10 22:08:56 -03:00
committed by Christoffer Lerno
parent 2237d3b836
commit 18ab18958b
3 changed files with 201 additions and 63 deletions

View File

@@ -7,7 +7,8 @@ ARG CMAKE_VERSION=3.20.0
# Prevent interactive prompts during apt install
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
RUN for i in 1 2 3; do apt-get update && break || sleep 2; done && \
apt-get install -y --fix-missing \
wget gnupg software-properties-common lsb-release \
zlib1g zlib1g-dev python3 ninja-build curl g++ libcurl4-openssl-dev git && \
CODENAME=$(lsb_release -cs) && \
@@ -19,14 +20,14 @@ RUN apt-get update && apt-get install -y \
rm cmake-${CMAKE_VERSION}-linux-${ARCH}.sh
RUN CODENAME=$(lsb_release -cs) && \
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
for i in 1 2; do wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key && break || sleep 2; done | apt-key add - && \
if [ "${LLVM_VERSION}" -ge 16 ]; then \
add-apt-repository "deb http://apt.llvm.org/${CODENAME}/ llvm-toolchain-${CODENAME}-${LLVM_VERSION} main"; \
else \
add-apt-repository "deb http://apt.llvm.org/${CODENAME}/ llvm-toolchain-${CODENAME} main"; \
fi && \
apt-get update && \
apt-get install -y \
for i in 1 2 3; do apt-get update && break || sleep 2; done && \
apt-get install -y --fix-missing \
clang-${LLVM_VERSION} \
clang++-${LLVM_VERSION} \
llvm-${LLVM_VERSION} \