Skip to content

Commit b2fc901

Browse files
authored
ci: Add CI workflow for testing with multiple Python versions (#7)
* Add CI workflow for testing with multiple Python versions - Created a GitHub Actions CI workflow in .github/workflows/ci.yml - Configured to run on pushes and pull requests to the main branch - Set up a matrix strategy to test against Python versions 3.11 and 3.12 - Steps include checking out the code, installing dependencies, and running checks with ruff and mypy - Added step to run tests using pytest * Add code coverage
1 parent e6c9b31 commit b2fc901

File tree

4 files changed

+610
-366
lines changed

4 files changed

+610
-366
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ["3.11", "3.12"]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v6
22+
with:
23+
version: "latest"
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Install dependencies
27+
run: uv sync --dev
28+
29+
- name: Run ruff check
30+
run: uv run ruff check
31+
32+
- name: Run ruff format check
33+
run: uv run ruff format --check
34+
35+
- name: Run mypy
36+
run: uv run mypy src/
37+
38+
- name: Run tests with coverage
39+
run: uv run pytest --cov=langdiff --cov-fail-under=75

CLAUDE.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ uv run pytest -v # Verbose output
2525
uv run pytest -k "test_name" # Run specific test by name pattern
2626
```
2727

28+
### Code Coverage
29+
```bash
30+
uv run pytest --cov=langdiff --cov-fail-under=75 # Run tests with 75% coverage requirement
31+
uv run pytest --cov=langdiff --cov-report=term-missing # Show missing lines in detail
32+
uv run pytest --cov=langdiff # Basic coverage report
33+
```
34+
2835
### Linting and Formatting
2936
```bash
3037
uv run ruff check # Check for linting issues
@@ -100,4 +107,4 @@ Development dependencies:
100107
Documentation dependencies:
101108
- `mkdocs`: Static site generator
102109
- `mkdocs-material`: Material Design theme for MkDocs
103-
- `mkdocstrings[python]`: Auto-generate API docs from docstrings
110+
- `mkdocstrings[python]`: Auto-generate API docs from docstrings

pyproject.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,26 @@ exclude = [
3434

3535
[dependency-groups]
3636
dev = [
37+
"mypy>=1.17.1",
3738
"openai>=1.99.1",
3839
"pytest>=8.4.1",
40+
"pytest-cov>=6.2.1",
3941
"ruff>=0.12.8",
4042
]
4143
docs = [
4244
"mkdocs>=1.6.0",
4345
"mkdocs-material>=9.5.0",
4446
"mkdocstrings[python]>=0.26.0",
4547
]
48+
49+
[tool.coverage.run]
50+
source = ["src"]
51+
omit = ["tests/*"]
52+
53+
[tool.coverage.report]
54+
exclude_lines = [
55+
"pragma: no cover",
56+
"def __repr__",
57+
"raise AssertionError",
58+
"raise NotImplementedError",
59+
]

0 commit comments

Comments
 (0)