Skip to content

Commit c9c7a6f

Browse files
committed
Add CI workflow configuration for linting, testing, and building
1 parent 559e004 commit c9c7a6f

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed

.github/workflows/ci.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
paths-ignore:
7+
- "**.md"
8+
- "docs/**"
9+
pull_request:
10+
branches: [ "main" ]
11+
types: [opened, synchronize, reopened]
12+
paths-ignore:
13+
- "**.md"
14+
- "docs/**"
15+
workflow_dispatch:
16+
17+
env:
18+
PYTHON_VERSION: "3.13"
19+
20+
jobs:
21+
lint:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: ${{ env.PYTHON_VERSION }}
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip uv
32+
uv venv .venv
33+
source .venv/bin/activate
34+
uv pip install -r requirements.txt
35+
uv pip install ruff
36+
- name: Lint with ruff
37+
run: ruff check .
38+
39+
test:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v4
43+
- name: Set up Python
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version: ${{ env.PYTHON_VERSION }}
47+
- name: Install dependencies
48+
run: |
49+
python -m pip install --upgrade pip uv
50+
uv venv .venv
51+
source .venv/bin/activate
52+
uv pip install -r requirements.txt
53+
uv pip install pytest pytest-asyncio pytest-cov
54+
- name: Test with pytest
55+
run: |
56+
python -m pytest -v --cov=src/ --cov-report=term --cov-report=xml:coverage.xml
57+
- name: Upload coverage reports
58+
uses: codecov/codecov-action@v4
59+
with:
60+
file: ./coverage.xml
61+
fail_ci_if_error: false
62+
63+
build:
64+
runs-on: ubuntu-latest
65+
needs: [lint, test]
66+
steps:
67+
- uses: actions/checkout@v4
68+
- name: Set up Python
69+
uses: actions/setup-python@v5
70+
with:
71+
python-version: ${{ env.PYTHON_VERSION }}
72+
- name: Install dependencies
73+
run: |
74+
python -m pip install --upgrade pip uv
75+
uv venv .venv
76+
source .venv/bin/activate
77+
uv pip install -r requirements.txt
78+
- name: Build package
79+
run: uv build
80+
- name: Upload artifacts
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: dist
84+
path: |
85+
dist/*.tar.gz
86+
dist/*.whl
87+
retention-days: 7

0 commit comments

Comments
 (0)