1+ name : CI
2+
3+ on :
4+ push :
5+ branches : [main]
6+ pull_request :
7+ branches : [main]
8+
9+ jobs :
10+ lint :
11+ name : Lint
12+ runs-on : ubuntu-latest
13+ steps :
14+ - name : Checkout code
15+ uses : actions/checkout@v4
16+
17+ - name : Set up Python
18+ uses : actions/setup-python@v5
19+ with :
20+ python-version : " 3.11"
21+
22+ - name : Install dependencies
23+ run : |
24+ python -m pip install --upgrade pip
25+ pip install ruff
26+
27+ - name : Run ruff check
28+ run : ruff check src tests
29+
30+ - name : Run ruff format check
31+ run : ruff format --check src tests
32+
33+ typecheck :
34+ name : Type Check
35+ runs-on : ubuntu-latest
36+ steps :
37+ - name : Checkout code
38+ uses : actions/checkout@v4
39+
40+ - name : Set up Python
41+ uses : actions/setup-python@v5
42+ with :
43+ python-version : " 3.11"
44+
45+ - name : Install dependencies
46+ run : |
47+ python -m pip install --upgrade pip
48+ pip install -e ".[dev]"
49+
50+ - name : Run mypy
51+ run : mypy src
52+
53+ test :
54+ name : Test (Python ${{ matrix.python-version }})
55+ runs-on : ubuntu-latest
56+ strategy :
57+ fail-fast : false
58+ matrix :
59+ python-version : ["3.10", "3.11", "3.12"]
60+
61+ steps :
62+ - name : Checkout code
63+ uses : actions/checkout@v4
64+
65+ - name : Install jq
66+ run : sudo apt-get update && sudo apt-get install -y jq
67+
68+ - name : Set up Python ${{ matrix.python-version }}
69+ uses : actions/setup-python@v5
70+ with :
71+ python-version : ${{ matrix.python-version }}
72+
73+ - name : Install dependencies
74+ run : |
75+ python -m pip install --upgrade pip
76+ pip install -e ".[dev]"
77+
78+ - name : Run tests
79+ run : pytest -m "not e2e" --cov=src --cov-report=term-missing --cov-report=xml --cov-fail-under=80
80+
81+ - name : Upload coverage report
82+ uses : codecov/codecov-action@v4
83+ if : matrix.python-version == '3.11'
84+ with :
85+ files : ./coverage.xml
86+ fail_ci_if_error : false
87+ verbose : true
0 commit comments