@@ -3,35 +3,44 @@ name: CI
33on :
44 push :
55 branches :
6- - main
76 - dev
87 pull_request :
98
109env :
11- DEFAULT_PYTHON : " 3.12 "
10+ UV_CACHE_DIR : /tmp/.uv-cache
1211
1312jobs :
1413 code-quality :
1514 runs-on : " ubuntu-latest"
1615 name : Check code quality
1716 steps :
18- - uses : " actions/checkout@v4"
19- - name : Set up Python ${{ env.DEFAULT_PYTHON }}
20- id : python
21- uses : actions/setup-python@v5.2.0
17+ - name : ⤵️ Checkout repository
18+ uses : actions/checkout@v4
19+
20+ - name : 🏗 Install uv and Python
21+ uses : astral-sh/setup-uv@v5
2222 with :
23- python-version : ${{ env.DEFAULT_PYTHON }}
24- cache : " pip"
25- cache-dependency-path : " requirements*"
26- - name : Install dependencies
23+ enable-cache : true
24+ cache-dependency-glob : " uv.lock"
25+ cache-local-path : ${{ env.UV_CACHE_DIR }}
26+
27+ - name : Install additional OS dependencies
2728 run : |
28- pip install -r requirements.txt
29- pip install -r requirements-test.txt
29+ sudo apt-get update
30+ sudo apt-get -y install \
31+ pkg-config \
32+ liblzma-dev
33+
34+ - name : 🏗 Install the project
35+ run : uv sync --locked --group lint
36+
3037 # Following steps cannot run by pre-commit.ci as repo = local
3138 - name : Run mypy
32- run : mypy deebot_client/
39+ run : uv run --frozen mypy deebot_client/
40+
3341 - name : Pylint review
34- run : pylint deebot_client/
42+ run : uv run --frozen pylint deebot_client/**/*.py
43+
3544 - name : Verify no getLogger usages
3645 run : scripts/check_getLogger.sh
3746
@@ -40,24 +49,74 @@ jobs:
4049 name : Run tests
4150 strategy :
4251 matrix :
43- python-version : ["3.12"]
52+ python-version :
53+ - " 3.12"
54+ - " 3.13"
4455 steps :
45- - uses : " actions/checkout@v4"
46- - name : Set up Python ${{ matrix.python-version }}
47- id : python
48- uses : actions/setup-python@v5.2.0
56+ - name : ⤵️ Checkout repository
57+ uses : actions/checkout@v4
58+
59+ - name : 🏗 Install uv and Python ${{ matrix.python-version }}
60+ uses : astral-sh/setup-uv@v5
4961 with :
62+ enable-cache : true
63+ cache-dependency-glob : " uv.lock"
64+ cache-local-path : ${{ env.UV_CACHE_DIR }}
5065 python-version : ${{ matrix.python-version }}
51- cache : " pip"
52- cache-dependency-path : " requirements*"
53- - name : Install dependencies
66+
67+ - name : Install additional OS dependencies
5468 run : |
55- pip install -r requirements.txt
56- pip install -r requirements-test.txt
69+ sudo apt-get update
70+ sudo apt-get -y install \
71+ pkg-config \
72+ liblzma-dev
73+
74+ - name : 🏗 Install the project
75+ run : uv sync --locked --group test
76+
5777 - name : Run pytest
58- run : pytest --cov=./ --cov-report=xml
78+ run : uv run --frozen pytest tests --cov=./ --cov-report=xml --junitxml=junit.xml -o junit_family=legacy
79+
5980 - name : Upload coverage to Codecov
60- uses : codecov/codecov-action@v4
81+ uses : codecov/codecov-action@v5
82+ with :
83+ fail_ci_if_error : true
84+
85+ - name : Upload test results to Codecov
86+ if : ${{ !cancelled() }}
87+ uses : codecov/test-results-action@v1
6188 with :
62- token : ${{ secrets.CODECOV_TOKEN }}
6389 fail_ci_if_error : true
90+
91+ benchmarks :
92+ runs-on : " ubuntu-latest"
93+ name : Run benchmarks
94+ steps :
95+ - name : ⤵️ Checkout repository
96+ uses : actions/checkout@v4
97+
98+ - name : 🏗 Install uv
99+ uses : astral-sh/setup-uv@v5
100+
101+ - name : 🏗 Setup Python
102+ uses : actions/setup-python@v5
103+ with :
104+ python-version-file : " .python-version"
105+
106+ - name : Install additional OS dependencies
107+ run : |
108+ sudo apt-get update
109+ sudo apt-get -y install \
110+ pkg-config \
111+ liblzma-dev
112+
113+ - name : 🏗 Install the project
114+ run : |
115+ uv export --group benchmark > requirements.txt
116+ uv pip install -e . --system -r requirements.txt
117+
118+ - name : Run benchmarks
119+ uses : CodSpeedHQ/action@main
120+ with :
121+ run : pytest tests/ --codspeed
122+ token : ${{ secrets.CODSPEED_TOKEN }}
0 commit comments