transformrs 1.0.0

An interface for AI APIs
Documentation
name: check

on:
  push:
    branches:
      - main
  pull_request:
  workflow_dispatch:

env:
  # Minimal version of Rust that transformrs supports.
  RUST_TOOLCHAIN: '1.81'

jobs:
  test:
    runs-on: ubuntu-22.04
    timeout-minutes: 30

    steps:
      - uses: actions/checkout@v4

      - uses: Swatinem/rust-cache@v2

      - run: rustup toolchain install ${{ env.RUST_TOOLCHAIN }}

      # Compile, but don't run.
      - run: cargo test --no-run

      - run: |
          cargo test --all-features

          echo "Running chat example"
          cargo run --example chat
          echo "Running debug example"
          cargo run --example debug
          echo "Running image-chat example"
          cargo run --example image-chat
          echo "Running streaming-chat example"
          cargo run --example streaming-chat
          echo "Running text-to-image example"
          cargo run --example text-to-image
          echo "Running text-to-speech example"
          cargo run --example text-to-speech
        env:
          DEEPINFRA_KEY: ${{ secrets.DEEPINFRA_KEY }}
          ELEVENLABS_KEY: ${{ secrets.ELEVENLABS_KEY }}
          GOOGLE_KEY: ${{ secrets.GOOGLE_KEY }}
          GROQ_KEY: ${{ secrets.GROQ_KEY }}
          HYPERBOLIC_KEY: ${{ secrets.HYPERBOLIC_KEY }}
          OPENAI_COMPATIBLE_KEY: ${{ secrets.OPENAI_COMPATIBLE_KEY }}
          OPENAI_KEY: ${{ secrets.OPENAI_KEY }}

      - run: RUSTDOCFLAGS="-D warnings" cargo doc


  typos:
    runs-on: ubuntu-22.04
    timeout-minutes: 10
    if: github.ref != 'refs/heads/main'

    steps:
      - uses: actions/checkout@v4

      - uses: crate-ci/typos@master
        with:
          files: '.'

  fmt:
    runs-on: ubuntu-22.04
    timeout-minutes: 10
    if: github.ref != 'refs/heads/main'

    steps:
      - uses: actions/checkout@v4

      - run: rustup toolchain install stable

      - run: cargo fmt --all --check

      - run: cargo clippy -- -Dwarnings