name: Test
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
workflow_dispatch:
workflow_call:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --extra dev
- name: Lint with ruff (check)
run: uv run ruff check src/ tests/
- name: Lint with ruff (format)
run: uv run ruff format --check src/ tests/
- name: Type check with mypy
run: uv run mypy src/
- name: Run tests with pytest
run: uv run pytest -v --cov=chuk_mcp_time --cov-report=xml --cov-report=term-missing -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 coverage report --fail-under=70