oar-ocr 0.7.1

An Optical Character Recognition (OCR) and Document Layout Analysis library written in Rust.
Documentation
name: Run Tests

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

env:
  CARGO_TERM_COLOR: always

jobs:
  preflight:
    name: Preflight
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy

      - name: Cache Cargo dependencies
        uses: Swatinem/rust-cache@v2

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

      - name: Run common Clippy lints
        run: |
          cargo clippy --all-targets --all -- -D warnings
          cargo clippy --all-targets -p oar-ocr-vl -- -D warnings

      - name: Check rustdoc warnings
        env:
          RUSTDOCFLAGS: -D warnings
        run: cargo doc --workspace --no-deps

  feature-matrix:
    name: Feature matrix (${{ matrix.package }})
    needs: preflight
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        include:
          - package: oar-ocr
          - package: oar-ocr-core
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

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

      - name: Cache Cargo dependencies
        uses: Swatinem/rust-cache@v2

      - name: Check all feature combinations
        run: cargo check -p ${{ matrix.package }} --all-features

  test:
    name: Test (${{ matrix.os }})
    needs: preflight
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: ubuntu-latest
            vl_feature_check: ""
          - os: macos-latest
            vl_feature_check: "--features metal"
          - os: windows-latest
            vl_feature_check: ""
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

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

      - name: Cache Cargo dependencies
        uses: Swatinem/rust-cache@v2

      - name: Run platform-specific Clippy lints
        if: matrix.vl_feature_check != ''
        run: cargo clippy --all-targets -p oar-ocr-vl ${{ matrix.vl_feature_check }} -- -D warnings

      - name: Run tests in debug mode
        run: cargo test --verbose --all