@@ -3,78 +3,77 @@ name: Python CI
33on :
44 push :
55 branches : [ main ]
6-
76 pull_request :
87 branches : [ main ]
98
109jobs :
11- lint :
10+ quality :
1211 name : Code Quality
1312 runs-on : ubuntu-latest
1413 steps :
15- - uses : actions/checkout@v3
16-
14+ - uses : actions/checkout@v4
15+
1716 - name : Set up Python
18- uses : actions/setup-python@v4
17+ uses : actions/setup-python@v5
1918 with :
2019 python-version : ' 3.11'
21-
22- - name : Install Poetry
23- uses : snok/install-poetry@v1
24- with :
25- version : latest
26- virtualenvs-create : true
27- virtualenvs-in-project : true
28-
29- - name : Load cached venv
30- id : cached-poetry-dependencies
31- uses : actions/cache@v3
20+
21+ - name : Install uv
22+ run : |
23+ curl -LsSf https://astral.sh/uv/install.sh | sh
24+ echo "$HOME/.cargo/bin" >> $GITHUB_PATH
25+
26+ - name : Set up uv cache
27+ uses : actions/cache@v4
3228 with :
33- path : .venv
34- key : venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
35-
29+ path : |
30+ ~/.cache/uv
31+ ~/.uv
32+ key : ${{ runner.os }}-uv-${{ hashFiles('**/pyproject.toml') }}
33+ restore-keys : |
34+ ${{ runner.os }}-uv-
35+
3636 - name : Install dependencies
37- if : steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
38- run : poetry install --no-interaction --no-root
37+ run : uv pip install -e '.[dependency-groups.dev]'
38+
39+ - name : Check formatting
40+ run : ruff format --check .
3941
40- - name : Check imports with isort
41- run : poetry run isort . --check-only --profile black
42-
43- - name : Check formatting with Black
44- run : poetry run black . --check
45-
46- - name : Lint with flake8
47- run : poetry run flake8 .
42+ - name : Run linting
43+ run : ruff check .
44+
45+ - name : Run type checking
46+ run : mypy .
4847
4948 test :
5049 name : Tests
51- needs : lint # This job will only run if lint job passes
50+ needs : quality
5251 runs-on : ubuntu-latest
5352 steps :
54- - uses : actions/checkout@v3
55-
53+ - uses : actions/checkout@v4
54+
5655 - name : Set up Python
57- uses : actions/setup-python@v4
56+ uses : actions/setup-python@v5
5857 with :
5958 python-version : ' 3.11'
60-
61- - name : Install Poetry
62- uses : snok/install-poetry@v1
63- with :
64- version : latest
65- virtualenvs-create : true
66- virtualenvs-in-project : true
67-
68- - name : Load cached venv
69- id : cached-poetry-dependencies
70- uses : actions/cache@v3
59+
60+ - name : Install uv
61+ run : |
62+ curl -LsSf https://astral.sh/uv/install.sh | sh
63+ echo "$HOME/.cargo/bin" >> $GITHUB_PATH
64+
65+ - name : Set up uv cache
66+ uses : actions/cache@v4
7167 with :
72- path : .venv
73- key : venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
74-
68+ path : |
69+ ~/.cache/uv
70+ ~/.uv
71+ key : ${{ runner.os }}-uv-${{ hashFiles('**/pyproject.toml') }}
72+ restore-keys : |
73+ ${{ runner.os }}-uv-
74+
7575 - name : Install dependencies
76- if : steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
77- run : poetry install --no-interaction --no-root
78-
76+ run : uv pip install -e '.[dependency-groups.dev]'
77+
7978 - name : Run tests
80- run : poetry run pytest tests/
79+ run : pytest tests/
0 commit comments