Harden KVM suite runner bootstrap
Some checks failed
KVM Publishable Validation / publishable-kvm-suite (push) Failing after 20s

This commit is contained in:
centra 2026-04-05 03:59:52 +09:00
parent 8bb926d66f
commit 26a306da1c
2 changed files with 15 additions and 3 deletions

View file

@ -40,12 +40,13 @@ jobs:
- name: Probe KVM Environment
run: |
set -euo pipefail
export PATH="/run/current-system/sw/bin:/usr/bin:/bin:$PATH"
if [[ -f /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh ]]; then
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
elif [[ -f "$HOME/.nix-profile/etc/profile.d/nix.sh" ]]; then
. "$HOME/.nix-profile/etc/profile.d/nix.sh"
fi
echo "hostname=$(hostname)"
echo "hostname=$(uname -n)"
uname -a
id
test -e /dev/kvm
@ -60,10 +61,11 @@ jobs:
- name: Run Publishable KVM Suite
run: |
set -euo pipefail
export PATH="/run/current-system/sw/bin:/usr/bin:/bin:$PATH"
if [[ -f /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh ]]; then
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
elif [[ -f "$HOME/.nix-profile/etc/profile.d/nix.sh" ]]; then
. "$HOME/.nix-profile/etc/profile.d/nix.sh"
fi
chmod +x ./nix/test-cluster/run-publishable-kvm-suite.sh
./nix/test-cluster/run-publishable-kvm-suite.sh "$RUNNER_TEMP/publishable-kvm-suite"
bash ./nix/test-cluster/run-publishable-kvm-suite.sh "$RUNNER_TEMP/publishable-kvm-suite"

View file

@ -1,6 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
export PATH="/run/current-system/sw/bin:/usr/bin:/bin:${PATH}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
LOG_DIR="${1:-${ULTRACLOUD_KVM_PUBLISHABLE_LOG_DIR:-${REPO_ROOT}/work/publishable-kvm-suite}}"
@ -11,10 +13,18 @@ log() {
printf '[publishable-kvm-suite] %s\n' "$*"
}
get_hostname() {
if command -v hostname >/dev/null 2>&1; then
hostname
else
uname -n
fi
}
capture_environment() {
{
printf 'started_at=%s\n' "$(date -Is)"
printf 'hostname=%s\n' "$(hostname)"
printf 'hostname=%s\n' "$(get_hostname)"
printf 'kernel=%s\n' "$(uname -a)"
printf 'pwd=%s\n' "$(pwd)"
printf 'user=%s\n' "$(id -un)"