name: Test Asgard Runner
# On-demand only — no reason to spin a container on every push.
on: [workflow_dispatch]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Test runner capabilities
        run: |
          echo "🚀 Running on Asgard!"
          echo "==========================================="
          echo "Hostname: $(hostname)"
          echo "CPU Cores: $(nproc)"
          echo "Memory: $(free -h | grep Mem | awk '{print $2}')"
          echo "Disk: $(df -h / | tail -1 | awk '{print $4}')"
          echo "==========================================="
          # Jobs run in a bare node:20-bullseye container: toolchains are NOT
          # preinstalled — workflows must bootstrap them (setup-go, rustup).
          # Report presence honestly instead of green-lighting a missing tool.
          for tool in go rustc docker node; do
            if command -v "$tool" >/dev/null 2>&1; then
              echo "$tool: $($tool --version 2>&1 | head -1)"
            else
              echo "$tool: NOT PRESENT (workflows must install per-run)"
            fi
          done
          echo "==========================================="
          echo "✅ Asgard runner reachable — container is node:20-bullseye, bootstrap toolchains per-run"
