Cache rustup+registry+target, reach cache server via LAN IP, fail on pipe errors
This commit is contained in:
1 parent
f45ca8ff95
commit
ff2270a64d
1 file changed
+19
-12
@@ -10,30 +10,37 @@ jobs:
|
|||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: sandbox
|
working-directory: sandbox
|
||||||
|
shell: bash
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Where am I?
|
- name: Where am I?
|
||||||
run: |
|
run: |
|
||||||
echo "runner : ${RUNNER_NAME}"
|
echo "runner : ${RUNNER_NAME}"
|
||||||
echo "os : $(grep PRETTY_NAME /etc/os-release | cut -d'"' -f2)"
|
echo "uid : $(id -u) cgroup: $(cut -d/ -f3 /proc/self/cgroup 2>/dev/null || echo n/a)"
|
||||||
echo "uid : $(id -u) cgroup: $(head -c 40 /proc/self/cgroup)"
|
echo "cache : ${ACTIONS_CACHE_URL:-unset}"
|
||||||
command -v git >/dev/null && echo "git : $(git --version)"
|
|
||||||
|
|
||||||
- name: Toolchain
|
# Restore first, so a warm cache also skips the toolchain download.
|
||||||
run: |
|
- name: Cache rust toolchain, registry and target
|
||||||
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
|
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cargo/registry
|
~/.cargo
|
||||||
~/.cargo/git
|
~/.rustup
|
||||||
sandbox/target
|
sandbox/target
|
||||||
key: cargo-${{ hashFiles('sandbox/Cargo.lock') }}
|
key: cargo-${{ hashFiles('sandbox/Cargo.lock') }}
|
||||||
restore-keys: cargo-
|
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
|
- 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
|
||||||
Reference in new issue
Block a user