Skip to content

Commit 726e87b

Browse files
ci: add multi-Python test matrix and coverage reporting
- Split CI into lint and test jobs for faster feedback - Add Python 3.10, 3.11, 3.12, 3.13 test matrix with fail-fast: false - Add pytest-cov to dev dependencies - Add coverage threshold enforcement (85%) in CI - Add 'make coverage' target for local coverage reporting
1 parent e0b1ed4 commit 726e87b

4 files changed

Lines changed: 167 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ on:
77
branches: [main]
88

99
jobs:
10-
ci:
11-
name: Lint, typecheck & test
10+
lint:
11+
name: Lint, format & typecheck
1212
runs-on: ubuntu-latest
1313

1414
steps:
@@ -36,5 +36,29 @@ jobs:
3636
- name: Typecheck (ty)
3737
run: uv run ty check
3838

39-
- name: Test (pytest)
40-
run: uv run pytest tests/ -q
39+
test:
40+
name: Test (Python ${{ matrix.python-version }})
41+
runs-on: ubuntu-latest
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
python-version: ["3.10", "3.11", "3.12", "3.13"]
46+
47+
steps:
48+
- uses: actions/checkout@v6
49+
50+
- name: Install uv
51+
uses: astral-sh/setup-uv@v7
52+
with:
53+
enable-cache: true
54+
55+
- name: Set up Python ${{ matrix.python-version }}
56+
uses: actions/setup-python@v6
57+
with:
58+
python-version: ${{ matrix.python-version }}
59+
60+
- name: Install dependencies
61+
run: uv sync --group dev
62+
63+
- name: Test with coverage
64+
run: uv run pytest tests/ -q --cov=evalwire --cov-report=term-missing --cov-fail-under=85

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.DEFAULT_GOAL := help
22

3-
.PHONY: help install install-dev install-demo sync lint format typecheck test check fix pre-commit docs docs-serve clean
3+
.PHONY: help install install-dev install-demo sync lint format typecheck test coverage check fix pre-commit docs docs-serve clean
44

55
help: ## Show this help message
66
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
@@ -30,6 +30,9 @@ typecheck: ## Run ty type checker
3030
test: ## Run pytest
3131
uv run pytest tests/ -q
3232

33+
coverage: ## Run pytest with coverage report
34+
uv run pytest tests/ -q --cov=evalwire --cov-report=term-missing --cov-fail-under=85
35+
3336
check: lint format typecheck test ## Run all checks (lint, format, typecheck, test)
3437

3538
fix: ## Auto-fix lint and format issues

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ dev = [
5050
"pre-commit>=4.5.1",
5151
"pytest>=8.0",
5252
"pytest-asyncio>=0.23",
53+
"pytest-cov>=6.0",
5354
"pytest-mock>=3.14",
5455
"ruff>=0.15.8",
5556
"ty>=0.0.26",

0 commit comments

Comments
 (0)