1212
1313jobs :
1414 setup :
15+ name : Setup
1516 runs-on : ubuntu-latest
17+ outputs :
18+ cache-hit : ${{ steps.setup_uv.outputs.cache-hit }}
1619 steps :
1720 - name : Checkout code
1821 uses : actions/checkout@v4
1922
20- - name : Set up Python
21- uses : actions/setup-python@v5
23+ - name : Install uv (+ enable cache)
24+ id : setup_uv
25+ uses : astral-sh/setup-uv@v6
2226 with :
23- python-version : 3.12
27+ enable-cache : true
2428
25- - name : Cache virtual environment
26- id : cached-virtualenv
27- uses : actions/cache@v4
28- with :
29- path : .venv
30- key : ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
31-
32- - name : Install dependencies
33- if : steps.cached-virtualenv.outputs.cache-hit != 'true'
34- run : |
35- python -m venv .venv
36- source .venv/bin/activate
37- pip install --upgrade pip
38- pip install poetry
39- poetry install
29+ - name : Sync dependencies
30+ run : uv sync --locked --dev
31+
32+ - name : Prune uv cache (optimized for CI)
33+ run : uv cache prune --ci
4034
4135 ruff-format :
36+ name : ruff-format
4237 needs : setup
4338 runs-on : ubuntu-latest
4439 steps :
4540 - name : Checkout code
4641 uses : actions/checkout@v4
4742
48- - name : Restore virtual environment cache
49- uses : actions/cache@v4
43+ - name : Install uv + restore cache
44+ uses : astral-sh/setup-uv@v6
5045 with :
51- path : .venv
52- key : ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
53-
54- - name : Set path
55- run : echo ${{ github.workspace }}/.venv/bin >> $GITHUB_PATH
46+ enable-cache : true
5647
57- - name : Check ruff version
58- run : ruff --version
59-
60- - name : Run ruff format check
61- run : ruff format --check .
48+ - name : Check ruff formatting
49+ run : uv run ruff format --check .
6250
6351 ruff-lint :
52+ name : ruff-lint
6453 needs : setup
6554 runs-on : ubuntu-latest
6655 steps :
6756 - name : Checkout code
6857 uses : actions/checkout@v4
6958
70- - name : Restore virtual environment cache
71- uses : actions/cache@v4
59+ - name : Install uv + restore cache
60+ uses : astral-sh/setup-uv@v6
7261 with :
73- path : .venv
74- key : ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
75-
76- - name : Set path
77- run : echo ${{ github.workspace }}/.venv/bin >> $GITHUB_PATH
78-
79- - name : Check ruff version
80- run : ruff --version
62+ enable-cache : true
8163
8264 - name : Run ruff lint
83- run : ruff check --output-format=github .
65+ run : uv run ruff check --output-format=github .
8466
8567 mypy-type-check :
68+ name : mypy-type-check
8669 needs : setup
8770 runs-on : ubuntu-latest
8871 steps :
8972 - name : Checkout code
9073 uses : actions/checkout@v4
9174
92- - name : Restore virtual environment cache
93- uses : actions/cache@v4
94- with :
95- path : .venv
96- key : ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
97-
98- - name : Set path
99- run : echo ${{ github.workspace }}/.venv/bin >> $GITHUB_PATH
100-
101- - name : Check mypy version
102- run : mypy --version
103-
104- - name : Run mypy type check
105- run : mypy .
106-
107- pytest :
108- needs : setup
109- runs-on : ubuntu-latest
110- steps :
111- - name : Checkout code
112- uses : actions/checkout@v4
113-
114- - name : Restore virtual environment cache
115- uses : actions/cache@v4
75+ - name : Install uv + restore cache
76+ uses : astral-sh/setup-uv@v6
11677 with :
117- path : .venv
118- key : ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
119-
120- - name : Set path
121- run : echo ${{ github.workspace }}/.venv/bin >> $GITHUB_PATH
78+ enable-cache : true
12279
123- - name : Run pytest
124- run : pytest tests/
80+ - name : Run mypy
81+ run : uv run --frozen mypy .
12582
12683 publish :
12784 runs-on : ubuntu-latest
@@ -132,12 +89,12 @@ jobs:
13289 - uses : actions/checkout@v4
13390 - uses : actions/setup-java@v4
13491 with :
135- java-version : ' 17 '
136- distribution : ' temurin'
92+ java-version : " 17 "
93+ distribution : " temurin"
13794 - name : Setup Gradle
13895 uses : gradle/actions/setup-gradle@v3
13996
14097 - name : Publish package
14198 run : cd java && ./gradlew publish
14299 env :
143- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
100+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments