Files
BrunoGaoSZandClaude Sonnet 4.6 dec280ad40 fix: unit tests in CI require dummy env vars for Settings import
- core/config.py: fix ANTHROPIC_MODEL default (claude-sonnet-4-6-20260217 → claude-sonnet-4-6)
- ci.yml unit-tests job: inject ANTHROPIC_AUTH_TOKEN/DATABASE_URL/REDIS_URL as dummy
  values so pydantic Settings() validates at collection time without a .env file

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28 17:42:22 +01:00

88 lines
2.0 KiB
YAML

name: CI
on:
pull_request:
branches: [master, main]
push:
branches: [master, main]
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint & Type Check
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install uv
run: pip install --no-cache-dir uv
- name: Install dependencies
run: uv sync --frozen
- name: Ruff lint
run: uv run ruff check . --select E,F,I --quiet
- name: Mypy type check
run: uv run mypy core/ api/ --ignore-missing-imports --no-error-summary
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
needs: lint
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install uv
run: pip install --no-cache-dir uv
- name: Install dependencies
run: uv sync --frozen
- name: Run unit tests
env:
ANTHROPIC_AUTH_TOKEN: sk-ant-ci-dummy
DATABASE_URL: postgresql+asyncpg://agent:dummy@localhost:5432/agent_platform
REDIS_URL: redis://localhost:6379/0
run: uv run pytest tests/unit/ -x -q --tb=short --cov=core --cov=api --cov-fail-under=80
integration-tests:
name: Integration Tests
runs-on: ubuntu-latest
needs: lint
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install uv
run: pip install --no-cache-dir uv
- name: Install dependencies
run: uv sync --frozen
- name: Run integration tests
run: uv run pytest tests/integration/ -x -q --tb=short -m "not claude_api" --timeout=60