name: Ambi CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
test:
runs-on: ubuntu-latest
services:
ollama:
image: ollama/ollama:latest
ports:
- 11434:11434
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential pkg-config curl
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Setup test environment (Ollama Model)
run: |
echo "Pulling a small model for testing..."
curl -X POST http://localhost:11434/api/pull -d '{"name": "qwen:0.5b"}'
- name: Check Formatting
run: cargo fmt --all -- --check
- name: Run Clippy (Linting)
run: cargo clippy --no-default-features --features openai-api -- -D warnings
- name: Build
run: cargo build --no-default-features --features openai-api --verbose
- name: Run tests
run: cargo test --no-default-features --features openai-api --verbose
env:
TEST_BASE_URL: "http://localhost:11434/v1"
TEST_MODEL_NAME: "qwen:0.5b"
OPENAI_API_KEY: "ollama"