ci: build and test on root self-hosted runners (#2237)

This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-11-07 17:02:19 -05:00
1 parent 8fa30b99f9
commit d29a1a2dc2
10 files changed
+59 -5

No files matched your search

+9 -4
View File
@@ -10,9 +10,13 @@ if [ "${#missing[@]}" = 0 ]; then
echo "Ubuntu build dependencies are already installed."
exit 0
fi
options=(
-o Dir::Etc::sourcelist=sources.list.d/ubuntu.sources
-o Dir::Etc::sourceparts=-
options=()
# Runners without the deb822 Ubuntu sources file keep their own apt configuration.
ubuntu_sources=${UBUNTU_SOURCES_FILE:-/etc/apt/sources.list.d/ubuntu.sources}
if [ -f "$ubuntu_sources" ]; then
options+=(-o "Dir::Etc::sourcelist=$ubuntu_sources" -o Dir::Etc::sourceparts=-)
fi
options+=(
-o Acquire::Retries=1
-o Acquire::http::Timeout=15
-o Acquire::https::Timeout=15
@@ -28,13 +32,14 @@ if install_packages; then
exit 0
fi
echo "::warning::Runner mirror failed or timed out; retrying with the official Ubuntu mirror."
[ -f "$ubuntu_sources" ] || exit 1
sources=$(mktemp --suffix=.sources)
trap 'rm -f "$sources"' EXIT
mirror=https://archive.ubuntu.com/ubuntu
case "$(dpkg --print-architecture)" in
arm64) mirror=https://ports.ubuntu.com/ubuntu-ports ;;
esac
sed -E "s@^URIs:.*@URIs: $mirror@" /etc/apt/sources.list.d/ubuntu.sources > "$sources"
sed -E "s@^URIs:.*@URIs: $mirror@" "$ubuntu_sources" > "$sources"
chmod 644 "$sources"
options[1]="Dir::Etc::sourcelist=$sources"
install_packages