langextract-rust 0.5.0

A Rust library for extracting structured and grounded information from text using LLMs
Documentation
name: CI

on:
  push:
    paths:
      - 'src/**'
      - 'Cargo.toml'
      - 'Cargo.lock'
      - '.github/workflows/**'
  pull_request:
    paths:
      - 'src/**'
      - 'Cargo.toml'
      - 'Cargo.lock'
      - '.github/workflows/**'

jobs:
  test:
    name: Test
    runs-on: ubuntu-latest
    strategy:
      matrix:
        rust: [stable, beta, nightly]
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ matrix.rust }}
          components: rustfmt, clippy
      
      - name: Format check
        run: cargo fmt --check
      
      - name: Clippy
        run: cargo clippy -- -D warnings
      
      - name: Test
        run: cargo test
      
      - name: Build
        run: cargo build --release
      
      - name: Build CLI
        run: cargo build --release --features cli
      
      - name: Test CLI
        run: cargo test --features cli

  test-cross-platform:
    name: Test Cross Platform
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
        rust: [stable]
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      
      - name: Cache cargo registry
        uses: actions/cache@v3
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
      
      - name: Test
        run: cargo test
      
      - name: Build CLI
        run: cargo build --release --features cli
      
      - name: Test CLI help
        run: |
          if [[ "${{ runner.os }}" == "Windows" ]]; then
            ./target/release/lx-rs.exe --help
          else
            ./target/release/lx-rs --help
          fi
        shell: bash

  security-audit:
    name: Security Audit
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      
      - name: Install cargo-audit
        run: cargo install cargo-audit
      
      - name: Audit dependencies
        run: cargo audit

  check-features:
    name: Check Feature Combinations
    runs-on: ubuntu-latest
    strategy:
      matrix:
        features:
          - ""
          - "openai"
          - "ollama"
          - "cli"
          - "openai,ollama"
          - "openai,cli"
          - "ollama,cli"
          - "openai,ollama,cli"
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      
      - name: Check feature combination
        run: |
          if [[ "${{ matrix.features }}" == "" ]]; then
            cargo check --no-default-features
          else
            cargo check --no-default-features --features "${{ matrix.features }}"
          fi