Cache rustup+registry+target, reach cache server via LAN IP, fail on pipe errors
Build RPi image / build (push) Successful in 10s
Sandbox - ephemeral runner + shared cache / cargo (push) Failing after 10s

This commit is contained in:
druppy committed 2026-10-24 21:27:35 +02:00
1 parent f45ca8ff95
commit ff2270a64d
1 file changed
+19 -12
+19 -12
View File
@@ -10,30 +10,37 @@ jobs:
defaults:
run:
working-directory: sandbox
shell: bash
steps:
- uses: actions/checkout@v4
- name: Where am I?
run: |
echo "runner : ${RUNNER_NAME}"
echo "os : $(grep PRETTY_NAME /etc/os-release | cut -d'"' -f2)"
echo "uid : $(id -u) cgroup: $(head -c 40 /proc/self/cgroup)"
command -v git >/dev/null && echo "git : $(git --version)"
echo "uid : $(id -u) cgroup: $(cut -d/ -f3 /proc/self/cgroup 2>/dev/null || echo n/a)"
echo "cache : ${ACTIONS_CACHE_URL:-unset}"
- name: Toolchain
run: |
command -v cargo >/dev/null || { apt-get update -qq && apt-get install -y -qq --no-install-recommends rustc cargo >/dev/null; }
cargo --version
- name: Cache cargo deps and target
# Restore first, so a warm cache also skips the toolchain download.
- name: Cache rust toolchain, registry and target
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo
~/.rustup
sandbox/target
key: cargo-${{ hashFiles('sandbox/Cargo.lock') }}
restore-keys: cargo-
- name: Toolchain
run: |
set -euo pipefail
if ! command -v cargo >/dev/null && [ ! -x "$HOME/.cargo/bin/cargo" ]; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable
fi
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
cargo --version
- name: Test
run: cargo test 2>&1 | tail -6
run: |
set -o pipefail # without this a failing build looks green
cargo test 2>&1 | tail -4