diff --git a/.github/workflows/kvm-publishable.yml b/.github/workflows/kvm-publishable.yml index b85f1b2..748b483 100644 --- a/.github/workflows/kvm-publishable.yml +++ b/.github/workflows/kvm-publishable.yml @@ -5,19 +5,38 @@ on: jobs: publishable-kvm-suite: - runs-on: ubuntu-latest + runs-on: + - self-hosted + - linux + - x64 timeout-minutes: 360 steps: - uses: actions/checkout@v4 - - uses: DeterminateSystems/nix-installer-action@v11 - - - uses: DeterminateSystems/magic-nix-cache-action@v8 + - name: Ensure Nix Is Available + run: | + set -euo pipefail + if ! command -v nix >/dev/null 2>&1; then + curl -L https://nixos.org/nix/install | sh -s -- --no-daemon + fi + 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 + mkdir -p "$HOME/.config/nix" + printf '%s\n' 'experimental-features = nix-command flakes' > "$HOME/.config/nix/nix.conf" + nix --version - name: Probe KVM Environment run: | set -euo pipefail + 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)" uname -a id @@ -33,5 +52,10 @@ jobs: - name: Run Publishable KVM Suite run: | set -euo pipefail + 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"