name: runner-health

# task-2566 Phase 1 — verifies self-hosted runner is reachable, can execute jobs,
# and that the bootstrap environment is intact. Decoupled from required CI.
# DO NOT add ubuntu-latest fallback (fail-closed if runner offline).

on:
  workflow_dispatch:
  push:
    branches:
      - task/task-2566-dev1
    paths:
      - '.github/workflows/runner-health.yml'
      - 'scripts/runner_bootstrap.sh'

permissions:
  contents: read

jobs:
  runner-health:
    runs-on: [self-hosted, linux, anu-ci]
    timeout-minutes: 5
    steps:
      - name: runner identity
        run: |
          echo "runner: $RUNNER_NAME"
          echo "labels: $RUNNER_OS / $RUNNER_ARCH"
          echo "workspace: $GITHUB_WORKSPACE"
          uname -a
      - uses: actions/checkout@v4
      - name: bootstrap validation
        run: bash scripts/runner_bootstrap.sh
      - name: marker
        run: echo "self-hosted runner healthy ($(date -u +%FT%TZ))"
