prefrontal 0.1.0

A blazing fast text classifier for real-time agent routing, built in Rust
Documentation
name: Rust

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

env:
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: 1
  RUST_LOG: debug
  # Set a specific cache directory for model downloads in CI
  PREFRONTAL_CACHE: /tmp/prefrontal-cache

jobs:
  test:
    name: Test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install latest stable
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true

      - name: Setup OpenSSL
        run: |
          sudo apt-get update
          sudo apt-get install -y pkg-config libssl-dev cmake
          # Verify OpenSSL installation
          pkg-config --libs openssl
          pkg-config --cflags openssl

      - name: Cache dependencies
        uses: actions/cache@v3
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
            /tmp/prefrontal-cache  # Cache downloaded model files
          key: ${{ runner.os }}-cargo-deps-${{ hashFiles('**/Cargo.lock') }}

      - name: Build
        run: cargo build --verbose
        env:
          ORT_STRATEGY: download

      - name: Run tests
        run: cargo test --verbose
        env:
          RUST_LOG: debug
          # Ensure tests run sequentially to avoid model download conflicts
          RUST_TEST_THREADS: 1