CI: main and merge-queue runs share the work with the self-hosted runner
Clippy, the doc tests and test shards 1-2 of pushes to main and merge-queue groups run on the self-hosted runner, alongside GitHub's runners for everything else. Pull requests, the nightly run and Run workflow stay on GitHub's runners. Clippy and the doc tests keep warm build directories outside the checkout (scripts/ci/warm-target.sh). The test archive is still built on GitHub's runners: the self-hosted machine has a newer glibc, so binaries built there don't start on ubuntu-24.04. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
c599238653
commit
ef3bdd3433
2 files changed
+38
-5
No files matched your search
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
# Self-hosted runner only: keep a job's Cargo build directory between runs, outside the
|
||||
# checkout (actions/checkout's clean would delete it), and point CARGO_TARGET_DIR at it for the
|
||||
# rest of the job. Usage: warm-target.sh NAME
|
||||
# Each self-hosted runner has its own /home/runner, so two never share a directory.
|
||||
set -euo pipefail
|
||||
name=${1:?usage: warm-target.sh NAME}
|
||||
dir=/home/runner/work/cargo-target/$name
|
||||
# Start over when it has grown past 40 GB: old dependency versions pile up.
|
||||
if [ -d "$dir" ] && [ "$(du -sm "$dir" | cut -f1)" -gt 40000 ]; then
|
||||
echo "warm-target: $dir is over 40 GB, starting a fresh build"
|
||||
rm -rf "$dir"
|
||||
fi
|
||||
mkdir -p "$dir"
|
||||
echo "CARGO_TARGET_DIR=$dir" >> "$GITHUB_ENV"
|
||||
echo "warm-target: $dir ($(du -sh "$dir" | cut -f1))"
|
||||
Reference in new issue
Block a user