Skip to content

Commit ea6180a

Browse files
committed
ci: add lint, typecheck, codegen drift, and pytest workflow on PR and push to main
1 parent 4ddcfdb commit ea6180a

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python: ['3.10', '3.11', '3.12', '3.13']
18+
steps:
19+
- uses: actions/checkout@v6
20+
21+
- uses: astral-sh/setup-uv@v7
22+
with:
23+
python-version: ${{ matrix.python }}
24+
enable-cache: true
25+
26+
- run: uv sync --all-extras --dev
27+
28+
- name: Codegen drift check
29+
if: matrix.python == '3.12'
30+
run: |
31+
uv run python generate.py
32+
git diff --exit-code -- specs/openapi.json src/roxy_sdk/factory.py \
33+
|| { echo 'codegen drift: commit the regenerated files'; exit 1; }
34+
35+
- name: Lint
36+
if: matrix.python == '3.12'
37+
run: uv run ruff check .
38+
39+
- name: Typecheck
40+
if: matrix.python == '3.12'
41+
run: uv run mypy src/roxy_sdk/__init__.py
42+
43+
- name: Test
44+
run: uv run pytest tests/test_factory.py -v

0 commit comments

Comments
 (0)