Runner Health Check #292
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Runner Health Check | |
| on: | |
| schedule: | |
| - cron: '0 */6 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| ping: | |
| runs-on: [self-hosted, macOS, keypath] | |
| timeout-minutes: 2 | |
| steps: | |
| - name: Runner is alive | |
| run: | | |
| echo "Runner: $(hostname)" | |
| echo "Uptime: $(uptime)" | |
| echo "Disk: $(df -h /Users | tail -1)" | |
| echo "Swift: $(swift --version 2>&1 | head -1)" | |
| echo "Kanata: $(kanata --version 2>&1 || echo 'not found')" | |
| - name: Verify SwiftPM label boundary | |
| run: | | |
| export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" | |
| runner_json="$(env -u GH_TOKEN -u GITHUB_TOKEN gh api "repos/${{ github.repository }}/actions/runners")" || { | |
| echo "Runner label audit requires the Mini's existing gh authentication." >&2 | |
| exit 1 | |
| } | |
| headless="$(jq -c '[.runners[] | select(.status == "online" and .name == "keypath-mini")]' <<<"$runner_json")" | |
| interactive="$(jq -c '[.runners[] | select(.status == "online" and .name == "keypath-mini-2")]' <<<"$runner_json")" | |
| [[ "$(jq 'length' <<<"$headless")" == "1" ]] || { | |
| echo "Expected exactly one online keypath-mini registration." >&2 | |
| exit 1 | |
| } | |
| [[ "$(jq 'length' <<<"$interactive")" == "1" ]] || { | |
| echo "Expected exactly one online keypath-mini-2 registration." >&2 | |
| exit 1 | |
| } | |
| headless_labels="$(jq -r '.[0] | [.labels[].name] | join(",")' <<<"$headless")" | |
| interactive_labels="$(jq -r '.[0] | [.labels[].name] | join(",")' <<<"$interactive")" | |
| [[ ",$headless_labels," != *",swiftpm-safe,"* ]] || { | |
| echo "Headless keypath-mini must not carry swiftpm-safe." >&2 | |
| exit 1 | |
| } | |
| [[ ",$interactive_labels," == *",swiftpm-safe,"* ]] || { | |
| echo "Interactive keypath-mini-2 must carry swiftpm-safe." >&2 | |
| exit 1 | |
| } |