openrouter_api 0.6.0

A Rust client library for the OpenRouter API
Documentation
name: Rust

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

env:
    CARGO_TERM_COLOR: always
    RUST_BACKTRACE: full
    OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}

jobs:
    build:
        runs-on: ubuntu-latest

        steps:
            - uses: actions/checkout@v4

            # Cache Cargo registry and build artifacts
            - name: Cache Cargo registry
              uses: actions/cache@v3
              with:
                  path: ~/.cargo/registry
                  key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
                  restore-keys: |
                      ${{ runner.os }}-cargo-registry-

            - name: Cache Cargo index
              uses: actions/cache@v3
              with:
                  path: ~/.cargo/git
                  key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
                  restore-keys: |
                      ${{ runner.os }}-cargo-git-

            - name: Cache target directory
              uses: actions/cache@v3
              with:
                  path: target
                  key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.lock') }}
                  restore-keys: |
                      ${{ runner.os }}-cargo-target-

            # Install Rust toolchain if needed
            - name: Set up Rust
              uses: actions-rs/toolchain@v1
              with:
                  toolchain: stable
                  override: true
                  components: clippy, rustfmt

            - name: Build
              run: cargo build --verbose

            - name: Run tests
              run: cargo test --verbose