Add lint github action
This commit is contained in:
parent
b64a2b08ee
commit
5844d07c5d
3 changed files with 35 additions and 4 deletions
23
.github/workflows/test.yml
vendored
23
.github/workflows/test.yml
vendored
|
|
@ -7,7 +7,26 @@ on:
|
|||
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 pyright
|
||||
|
||||
test:
|
||||
needs: lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
|
@ -22,7 +41,3 @@ jobs:
|
|||
run: uv sync --all-extras
|
||||
- name: Run tests
|
||||
run: uv run pytest
|
||||
- name: Type check
|
||||
run: uv run pyright
|
||||
- name: Lint
|
||||
run: uv run ruff check
|
||||
|
|
|
|||
12
CHANGELOG.md
12
CHANGELOG.md
|
|
@ -1,6 +1,18 @@
|
|||
# Changelog
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- **GitHub Actions CI**: Test workflow runs pytest, pyright, and ruff on push/PR to main
|
||||
- **VCR Cassette Recording**: Integration tests use recorded HTTP responses for deterministic CI runs
|
||||
- LLM tests (QA, embeddings, research graph) replay from cassettes without real API calls
|
||||
- docling-serve tests run without Docker container in CI
|
||||
- Uses pytest-recording with custom JSON body serializer
|
||||
|
||||
### Removed
|
||||
|
||||
- Removed obsolete `test_config_validation_on_db_load` test (chunk_size changes don't invalidate database)
|
||||
|
||||
## [0.23.0] - 2025-12-26
|
||||
|
||||
### Added
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import importlib.util
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
|
@ -8,6 +9,8 @@ from haiku.rag.client import HaikuRAG
|
|||
from haiku.rag.config.models import ModelConfig
|
||||
from haiku.rag.qa.agent import QuestionAnswerAgent
|
||||
|
||||
HAS_ANTHROPIC = importlib.util.find_spec("anthropic") is not None
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def vcr_cassette_dir():
|
||||
|
|
@ -63,6 +66,7 @@ async def test_qa_openai(allow_model_requests, qa_corpus: Dataset, temp_db_path)
|
|||
|
||||
|
||||
@pytest.mark.vcr()
|
||||
@pytest.mark.skipif(not HAS_ANTHROPIC, reason="Anthropic not installed")
|
||||
async def test_qa_anthropic(allow_model_requests, qa_corpus: Dataset, temp_db_path):
|
||||
"""Test Anthropic QA with LLM judge (VCR recorded)."""
|
||||
client = HaikuRAG(temp_db_path, create=True)
|
||||
|
|
|
|||
Loading…
Reference in a new issue