name: CI
on:
pull_request:
merge_group:
push:
branches:
- main
env:
CARGO_TERM_COLOR: always
RUST_TOOLCHAIN: "1.96.0"
RUST_LOG: debug
RUST_BACKTRACE: 1
RUSTFLAGS: "-Dwarnings"
TAVILY_API_KEY: noop
KWAAK_OPENAI_API_KEY: noop
KWAAK_GITHUB_TOKEN: noop
jobs:
test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Install Rust ${{ env.RUST_TOOLCHAIN }}
uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Test default features
run: cargo test -j 2
- name: Test OpenAI and mock features
run: cargo test -j 2 --no-default-features --features openai,mock
- name: Test Responses and mock features
run: cargo test -j 2 --no-default-features --features responses,mock
- name: Test all features
run: cargo test -j 2 --all-features
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
- name: Install Rust ${{ env.RUST_TOOLCHAIN }}
uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: clippy, rustfmt
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check typos
uses: crate-ci/typos@master
- name: "Rustfmt"
run: cargo fmt --all --check
- name: clippy
run: cargo clippy --all-targets --all-features