name: Run Tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
clippy-features: ""
- os: macos-latest
clippy-features: "--features metal"
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 Clippy linter
run: |
cargo clippy --all-targets --all -- -D warnings
cargo clippy --all-targets -p oar-ocr-vl ${{ matrix.clippy-features }} -- -D warnings
- name: Run tests in debug mode
run: cargo test --verbose --all