# PR + push CI for the course. Reports a commit status the claude-deck autopilot
# review gate reads, and runs the same build/test the gate runs on the merged tree:
#   build = render the wiki from this tree (proves the generator works)
#   test  = tools/check.sh (lab compile + parse + no-slop guard + structure)
name: CI
on:
  pull_request: {}
  push:
    branches: [main]
  workflow_dispatch: {}

jobs:
  check:
    runs-on: docker
    steps:
      - uses: actions/checkout@v4
      - name: build (render wiki) + test (check.sh)
        shell: bash
        run: |
          set -euo pipefail
          command -v python3 >/dev/null || { apt-get update && apt-get install -y --no-install-recommends python3 python3-pip; }
          python3 -c "import yaml" 2>/dev/null || python3 -m pip install --quiet pyyaml 2>/dev/null || true
          python3 tools/build_wiki.py --repo-root . --out /tmp/awc-wiki-build \
            --web-base https://git.jpaul.io/justin/ai-workflow-course --branch main --host gitea
          bash tools/check.sh
