doc-scraper-rs 0.1.0

The fastest, cleanest way to export GitBook docs as markdown.
name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

env:
  CARGO_TERM_COLOR: always

jobs:
  check:
    name: Lint, build, test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7

      - name: Install Rust toolchain (stable)
        uses: dtolnay/rust-toolchain@stable

      - name: Cache cargo registry and target
        uses: actions/cache@v6
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
          restore-keys: |
            ${{ runner.os }}-cargo-

      - name: cargo fmt --check
        run: cargo fmt --all -- --check

      - name: cargo clippy (all targets, deny warnings)
        run: cargo clippy --all-targets -- -D warnings

      # All tests are offline: `tests/integration.rs` spins up `wiremock`
      # to emulate the GitBook `.md` endpoint and soft-404 stub. Network
      # access is not required.
      - name: cargo test (release, offline only)
        run: cargo test --release

      - name: cargo doc (no deps, deny warnings)
        run: RUSTDOCFLAGS="-D warnings" cargo doc --no-deps

      - name: cargo publish --dry-run
        run: cargo publish --dry-run