name: Lean Check
on: [push, pull_request]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install Lean
        uses: leanprover/lean-action@v1
      - name: Build default target
        run: lake build
      - name: Build formal library
        run: lake build SilverSightFormal
      - name: Check for sorry
        run: |
          SORRY_COUNT=$(grep -rn "sorry" Core/ formal/ || true | wc -l)
          if [ "$SORRY_COUNT" -gt 0 ]; then
            echo "ERROR: Found $SORRY_COUNT sorry markers"
            exit 1
          fi
      - name: Check for admit
        run: |
          ADMIT_COUNT=$(grep -rn "admit" Core/ formal/ || true | wc -l)
          if [ "$ADMIT_COUNT" -gt 0 ]; then
            echo "ERROR: Found $ADMIT_COUNT admit markers"
            exit 1
          fi
