7c7ba21c90
The GitHub runners usually have about 14 GB of free space. This is not enough to build a full Fedora kernel with debug symbols. Disabling the debug symbols is not an option, because they are needed to generate data for BPF programs, and because it would mean more patches to the spec file which I would like to avoid. The runners contain a bunch of software that is entirely useless for our purposes. For example, a full .NET distribution, the entire Android SDK, and a bunch of cached container images that arent Fedora. However, with GitHubs container directive it is not possible to remove these, because no custom code is ever executed on the runner itself. To execute code on the runner, the container has to be created and used manually. To simplify this, all of the actual logic has been moved to a dedicated script, similar to how the CI on iptsd is set up.
46 lines
775 B
Bash
46 lines
775 B
Bash
#!/usr/bin/env bash
|
|
|
|
set -euxo pipefail
|
|
|
|
if [ -z "${GITHUB_REPOSITORY_ID:-}" ]; then
|
|
echo "GITHUB_REPOSITORY_ID is unset!"
|
|
exit 1
|
|
fi
|
|
|
|
if [ -z "${1:-}" ]; then
|
|
echo "Arguments are unset!"
|
|
exit 1
|
|
fi
|
|
|
|
ENVVARS=()
|
|
COMMAND=()
|
|
|
|
while (( "${#}" )); do
|
|
case "$1" in
|
|
-e)
|
|
ENVVARS+=("-e")
|
|
shift
|
|
|
|
ENVVARS+=("$1")
|
|
shift
|
|
;;
|
|
--)
|
|
shift
|
|
while (( "${#}" )); do
|
|
COMMAND+=("$1")
|
|
shift
|
|
done
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if command -v docker &> /dev/null; then
|
|
DOCKER="docker"
|
|
elif command -v podman &> /dev/null; then
|
|
DOCKER="podman"
|
|
else
|
|
echo "Could not find docker / podman!"
|
|
exit 1
|
|
fi
|
|
|
|
exec "${DOCKER}" exec "${ENVVARS[@]}" "${GITHUB_REPOSITORY_ID}" "${COMMAND[@]}" |