ookcite-mcp 0.4.5

MCP server for OokCite citation validation and formatting
Documentation
name: CI

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

env:
  CARGO_TERM_COLOR: always

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v5

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

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

      - name: Run tests
        env:
          # Contract test decrypts contract/openapi.json.age using this key.
          # External forks cannot run the contract test (expected behavior).
          OOKCITE_CONTRACT_KEY: ${{ secrets.OOKCITE_CONTRACT_KEY }}
        run: |
          if [ -n "$OOKCITE_CONTRACT_KEY" ]; then
            echo "Running all tests including contract validation"
            cargo test --all-targets
          else
            echo "OOKCITE_CONTRACT_KEY not available (fork?), skipping contract test"
            cargo test --all-targets -- --skip api_contract
          fi

      - name: Check formatting
        run: cargo fmt --check

      - name: Clippy
        run: cargo clippy --all-targets -- -D warnings

  # Verify the crate builds on all release targets (quick smoke test)
  build-check:
    strategy:
      matrix:
        include:
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-latest
          - target: x86_64-apple-darwin
            os: macos-latest
          - target: x86_64-pc-windows-msvc
            os: windows-latest

    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v5

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          targets: ${{ matrix.target }}

      - name: Build
        run: cargo build --target ${{ matrix.target }}