name: Build and test NixOS config on: pull_request: branches: [ master ] paths: - '**.nix' - 'flake.lock' - 'secrets/**' - 'hosts/**' - 'modules/**' push: branches: [ master ] paths: - '**.nix' - 'flake.lock' - 'secrets/**' - 'hosts/**' - 'modules/**' jobs: build: runs-on: nixos-builder steps: - name: Checkout run: | git clone -b "${{ github.head_ref || github.ref_name }}" \ https://gitea:${{ secrets.GITHUB_TOKEN }}@code.lazyworkhorse.net/gortium/infra.git . git log --oneline -3 - name: Build NixOS config run: | nix --version nh os build .#lazyworkhorse 2>&1 - name: Run integration tests (staging VM) run: | echo "==> Running integration tests on staging VM..." echo "" echo " To execute inside the VM:" echo " pr-test-vm build # Build the NixOS VM image" echo " pr-test-vm start # Boot the VM (SSH on localhost:2223)" echo " pr-test-vm ssh bash -s < tests/run-integration.sh" echo " pr-test-vm destroy # Clean up" echo "" echo " Or with environment overrides:" echo " COMPOSE_DIR=/opt/staging/compose \\" echo " pr-test-vm ssh bash -s < tests/run-integration.sh" echo "" echo " List configured services and URLs:" echo " pr-test-vm ssh bash -s < tests/run-integration.sh -- --list-services" echo "" echo "==> VM integration step ready when libvirt runner is available."