perf: incremental cargo builds, skip apt when cached

- Build in $HOME/archy to reuse target/ cache across CI runs
- Skip apt-get install when ISO build deps already present
- Cargo tests also use persistent target dir

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dorian 2026-04-07 16:08:29 +01:00
parent 9eb5d8cee0
commit b0e5e8c00e

View File

@ -28,17 +28,28 @@ jobs:
- name: Install ISO build dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq \
debootstrap squashfs-tools xorriso \
isolinux syslinux-common mtools \
grub-efi-amd64-bin grub-pc-bin grub-common
# Skip apt if packages already installed (persistent runner)
if dpkg -s debootstrap squashfs-tools xorriso isolinux syslinux-common mtools \
grub-efi-amd64-bin grub-pc-bin grub-common >/dev/null 2>&1; then
echo "ISO build deps already installed, skipping apt"
else
sudo apt-get update -qq
sudo apt-get install -y -qq \
debootstrap squashfs-tools xorriso \
isolinux syslinux-common mtools \
grub-efi-amd64-bin grub-pc-bin grub-common
fi
- name: Build backend
- name: Build backend (incremental)
run: |
source $HOME/.cargo/env 2>/dev/null || true
# Build in persistent repo dir to reuse target/ cache
cd "$HOME/archy"
export GIT_HASH=$(git rev-parse --short HEAD)
cargo build --release --manifest-path core/Cargo.toml
# Copy binary to workspace for downstream steps
mkdir -p "$GITHUB_WORKSPACE/core/target/release"
cp core/target/release/archipelago "$GITHUB_WORKSPACE/core/target/release/"
- name: Build frontend
run: cd neode-ui && npm ci && npm run build
@ -52,6 +63,7 @@ jobs:
- name: Run container orchestration unit tests
run: |
source $HOME/.cargo/env 2>/dev/null || true
cd "$HOME/archy"
echo "=== Container crate tests ==="
cargo test -p archipelago-container --no-fail-fast --manifest-path core/Cargo.toml
echo ""