Skip to content

Commit 46b9d51

Browse files
committed
Add CI
1 parent 8b1e58c commit 46b9d51

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

.github/workflows/ci.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
release:
11+
types:
12+
- created
13+
14+
jobs:
15+
tests:
16+
name: Tests (Python ${{ matrix.python-version }})
17+
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
python-version: ["3.10", "3.11", "3.12"]
22+
env:
23+
UV_PYTHON: ${{ matrix.python-version }}
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Set up uv
30+
uses: astral-sh/setup-uv@v2
31+
32+
- name: Install Python ${{ matrix.python-version }}
33+
run: uv python install ${{ matrix.python-version }}
34+
35+
- name: Sync dependencies
36+
run: uv sync --frozen --dev
37+
38+
- name: Run pytest
39+
run: uv run coverage run -m pytest . -vv && uv run coverage report -m
40+
41+
publish:
42+
needs: tests
43+
if: github.event_name == 'release'
44+
runs-on: ubuntu-latest
45+
env:
46+
UV_PYTHON: "3.10"
47+
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v4
51+
52+
- name: Set up uv
53+
uses: astral-sh/setup-uv@v2
54+
55+
- name: Install Python
56+
run: uv python install 3.11
57+
58+
- name: Sync runtime dependencies
59+
run: uv sync --frozen
60+
61+
- name: Build artifacts
62+
run: uv build
63+
64+
- name: Publish to PyPI
65+
run: uv publish --token ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)