name: Test
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.11", "3.12", "3.13"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: |
uv sync --all-extras --dev
- name: Lint with ruff
run: |
uv run ruff check src/ tests/
- name: Format check with ruff
run: |
uv run ruff format --check src/ tests/
- name: Type check with mypy
run: |
uv run mypy src/
- name: Run tests
run: |
uv run pytest tests/ -v --tb=short -m "not network"
- name: Run tests with coverage
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
run: |
uv run pytest tests/ --cov=src/chuk_mcp_solver --cov-report=xml --cov-report=term -m "not network"
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
- name: Check coverage threshold
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
run: |
uv run pytest tests/ --cov=src/chuk_mcp_solver --cov-report=term --cov-fail-under=90 -m "not network"