95 lines
2.8 KiB
YAML
95 lines
2.8 KiB
YAML
name: Tests
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: astral-sh/setup-uv@v4
|
|
with:
|
|
enable-cache: true
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version-file: "pyproject.toml"
|
|
- name: Install dependencies
|
|
run: uv sync --all-extras
|
|
- name: Lint
|
|
run: uv run ruff check
|
|
- name: Type check
|
|
run: uv run ty check
|
|
|
|
lint-frontend:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "22"
|
|
cache: "pnpm"
|
|
cache-dependency-path: app/frontend/pnpm-lock.yaml
|
|
- name: Install dependencies
|
|
working-directory: app/frontend
|
|
run: pnpm install --frozen-lockfile
|
|
- name: Lint and format check
|
|
working-directory: app/frontend
|
|
run: pnpm run check
|
|
|
|
test:
|
|
needs: [lint, lint-frontend]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: astral-sh/setup-uv@v4
|
|
with:
|
|
enable-cache: true
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version-file: "pyproject.toml"
|
|
- name: Install dependencies
|
|
run: uv sync --all-extras
|
|
- name: Cache HuggingFace models
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.cache/huggingface
|
|
key: huggingface-${{ runner.os }}-qwen-tokenizer-v1
|
|
- name: Pre-download tokenizer
|
|
run: uv run python -c "from transformers import AutoTokenizer; AutoTokenizer.from_pretrained('Qwen/Qwen3-Embedding-0.6B')"
|
|
- name: Run tests with coverage
|
|
run: uv run pytest -m "not integration" --cov=haiku --cov-report=xml
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v5
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
files: ./coverage.xml
|
|
fail_ci_if_error: false
|
|
|
|
test-docker-sandbox:
|
|
needs: [lint]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: astral-sh/setup-uv@v4
|
|
with:
|
|
enable-cache: true
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version-file: "pyproject.toml"
|
|
- name: Install dependencies
|
|
run: uv sync --all-extras
|
|
- name: Build Docker image
|
|
run: docker build -t haiku-rag-slim:test -f docker/Dockerfile.slim .
|
|
- name: Run Docker integration tests
|
|
run: uv run pytest tests/agents/rlm/test_sandbox.py -v
|