feat(book): Phase 6 execution validation harness (FALSIFY-BOOK-EXAMPLE-EXECUTES-001 / -COMPILES-001) #345
Workflow file for this run
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: mdBook CI | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "book/**" | |
| - "scripts/extract-book-examples.sh" | |
| - "scripts/extract_book_examples.py" | |
| - "scripts/check_book_*.sh" | |
| - "scripts/_build_rust_compile_test.py" | |
| - "contracts/apr-book-completeness-v1.yaml" | |
| - ".github/workflows/book.yml" | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - "book/**" | |
| - "scripts/extract-book-examples.sh" | |
| - "scripts/extract_book_examples.py" | |
| - "scripts/check_book_*.sh" | |
| - "scripts/_build_rust_compile_test.py" | |
| - "contracts/apr-book-completeness-v1.yaml" | |
| - ".github/workflows/book.yml" | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| name: Build Book | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install mdBook | |
| run: | | |
| mkdir -p ~/bin | |
| curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.40/mdbook-v0.4.40-x86_64-unknown-linux-gnu.tar.gz | tar -xz -C ~/bin | |
| echo "$HOME/bin" >> $GITHUB_PATH | |
| - name: Build book | |
| run: mdbook build book | |
| # BOOK-CLOSEOUT-001 § Phase 1: zero broken file links | |
| - name: Linkcheck gate (FALSIFY-BOOK-LINKCHECK-001) | |
| run: bash scripts/check_book_linkcheck.sh | |
| # BOOK-CLOSEOUT-001 § Phase 4: every CLI subcommand has a chapter | |
| - name: CLI parity gate (FALSIFY-BOOK-CLI-PARITY-001) | |
| run: | | |
| # apr CLI binary needed for parity check | |
| cargo install --path crates/apr-cli --locked --quiet | |
| bash scripts/check_book_cli_parity.sh | |
| # BOOK-CLOSEOUT-001 § Phase 4: every CLI stub has a runnable example | |
| - name: CLI example-block gate (FALSIFY-BOOK-EXAMPLE-001) | |
| run: bash scripts/check_book_example_block.sh | |
| # BOOK-CLOSEOUT-001 § Phase 3: every aprender-core public module has a chapter | |
| - name: Library parity gate (FALSIFY-BOOK-LIB-PARITY-001) | |
| run: bash scripts/check_book_lib_parity.sh | |
| # BOOK-CLOSEOUT-001 § Phase 3: every lib stub has a runnable rust example | |
| - name: Library example-block gate (FALSIFY-BOOK-LIB-EXAMPLE-001) | |
| run: bash scripts/check_book_lib_example_block.sh | |
| # BOOK-CLOSEOUT-001 § Phase 6: every bash example actually runs (or skips on a CI-acceptable reason) | |
| # <!-- ci-fixture-needed: qwen2.5-coder-1.5b --> | |
| # Until the runner provisions ~/models/ with the qwen2.5-coder-1.5b | |
| # weights, all model-required examples will SKIP (not FAIL) — that is the | |
| # designed behaviour. The gate fails only on hard FAILs. | |
| - name: Phase 6 — bash example execution gate (FALSIFY-BOOK-EXAMPLE-EXECUTES-001) | |
| run: bash scripts/check_book_examples_executable.sh | |
| # BOOK-CLOSEOUT-001 § Phase 6: every rust example compiles | |
| - name: Phase 6 — rust example compilation gate (FALSIFY-BOOK-EXAMPLE-COMPILES-001) | |
| run: bash scripts/check_book_examples_compile.sh | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v5 | |
| with: | |
| path: ./book/book | |
| deploy: | |
| name: Deploy to GitHub Pages | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |