#!/usr/bin/env bash set -euo pipefail # The local distribution gate pulls the 7 GB Ollama image, downloads the default embedding # model, builds the application images, and then archives every durable volume. GitHub's hosted # Linux image also ships toolchains this job never uses. Remove only those known, runner-owned # installations so the backup is tested with the production semantic stack instead of a stub. [[ "$(uname -s)" == Linux ]] || { printf 'Linux is required for hosted-runner disk preparation.\n' >&2 exit 1 } readonly unused_toolchains=( /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup ) for path in "${unused_toolchains[@]}"; do [[ -e "$path" || -L "$path" ]] || continue sudo rm -rf -- "$path" done sudo apt-get clean docker system prune --all --force df -h / docker system df