mirror of
https://github.com/turnstonelabs/turnstone.git
synced 2026-08-12 23:12:23 -06:00
c39affbf6b
* Add test coverage reporting and pre-commit hooks - Add pytest-cov to test dependencies, configure coverage in pyproject.toml (branch coverage, static asset omission, standard exclusion patterns) - CI test job now runs with --cov and uploads coverage XML as artifact - Add .pre-commit-config.yaml with ruff (check + format) and mypy hooks Baseline coverage: 41% (482 tests, Python 3.13) * Fix Copilot review: add redis dep for pre-commit mypy, explicit --cov target - Add redis>=7.2 to mypy pre-commit hook additional_dependencies so mypy can resolve redis imports in isolated pre-commit environments - Use --cov=turnstone instead of bare --cov to explicitly scope coverage
49 lines
1.2 KiB
YAML
49 lines
1.2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.13"
|
|
- run: pip install ruff
|
|
- run: ruff check turnstone/ tests/
|
|
- run: ruff format --check turnstone/ tests/
|
|
|
|
typecheck:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.13"
|
|
- run: pip install mypy types-redis
|
|
- run: pip install -e ".[mq]"
|
|
- run: mypy turnstone/
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.11", "3.12", "3.13"]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- run: pip install -e ".[test,mq]"
|
|
- run: pytest tests/ -m "not live" --cov=turnstone --cov-report=term-missing --cov-report=xml -q
|
|
- uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: coverage-${{ matrix.python-version }}
|
|
path: coverage.xml
|