Skip to content

Commit 2b9a464

Browse files
committed
ci: Update test workflow to python 3.13/3.14 without tox
1 parent cd87dbe commit 2b9a464

3 files changed

Lines changed: 414 additions & 55 deletions

File tree

.github/workflows/pytest.yaml

Lines changed: 42 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,67 +24,85 @@ on:
2424

2525
jobs:
2626
tests:
27-
needs: prek
2827
runs-on: ubuntu-latest
2928
name: Pytest
3029
strategy:
3130
matrix:
3231
python-version:
32+
- "3.13"
3333
- "3.14"
3434

3535
steps:
3636
- name: 📥 Checkout the repository
37-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
37+
uses: actions/checkout@v4
3838
with:
3939
fetch-depth: 2
4040
- name: 🛠️ Set up Python ${{ matrix.python-version }}
41-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
41+
uses: actions/setup-python@v5
4242
with:
4343
python-version: ${{ matrix.python-version }}
4444
- name: 🚀 Install uv
45-
uses: astral-sh/setup-uv@e58605a9b6da7c637471fab8847a5e5a6b8df081 # v5
46-
- name: 📦 Install tox
47-
run: uv pip install --system tox tox-gh-actions
48-
- name: 🏃 Run tox
49-
run: tox
45+
uses: astral-sh/setup-uv@v5
46+
- name: 📦 Install requirements
47+
run: uv pip install --system ".[test]"
48+
- name: 🏃 Run pytest
49+
run: pytest tests --cov=custom_components/keymaster --cov-report=xml
5050
- name: 📤 Upload coverage artifact
51-
if: matrix.python-version == '3.14'
52-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
51+
uses: actions/upload-artifact@v4
5352
with:
5453
name: coverage-data
5554
path: coverage.xml
5655

57-
prek:
56+
lint:
5857
runs-on: ubuntu-latest
59-
name: Prek
58+
name: Lint (ruff)
6059
steps:
6160
- name: 📥 Checkout the repository
62-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
63-
- name: 🛠️ Set up Node
64-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
61+
uses: actions/checkout@v4
62+
- name: 🛠️ Set up Python
63+
uses: actions/setup-python@v5
6564
with:
66-
node-version: "lts/iron"
67-
- name: 📦 Install dependencies
68-
run: yarn install
69-
- name: 🔍 Run prek
70-
uses: j178/prek-action@6ad80277337ad479fe43bd70701c3f7f8aa74db3 # v2.0.3
65+
python-version: "3.13"
66+
- name: 🚀 Install uv
67+
uses: astral-sh/setup-uv@v5
68+
- name: 📦 Install requirements
69+
run: uv pip install --system ".[test]"
70+
- name: 🧹 Run ruff format check
71+
run: ruff format --check custom_components/ tests/
72+
- name: 🔍 Run ruff check
73+
run: ruff check custom_components/ tests/
74+
75+
mypy:
76+
runs-on: ubuntu-latest
77+
name: Type check (mypy)
78+
steps:
79+
- name: 📥 Checkout the repository
80+
uses: actions/checkout@v4
81+
- name: 🛠️ Set up Python
82+
uses: actions/setup-python@v5
7183
with:
72-
extra-args: --all-files --skip no-commit-to-branch
84+
python-version: "3.13"
85+
- name: 🚀 Install uv
86+
uses: astral-sh/setup-uv@v5
87+
- name: 📦 Install requirements
88+
run: uv pip install --system ".[test]"
89+
- name: 🔎 Run mypy
90+
run: mypy custom_components/keymaster
7391

7492
coverage:
7593
runs-on: ubuntu-latest
7694
needs: tests
7795
steps:
7896
- name: 📥 Checkout the repository
79-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
97+
uses: actions/checkout@v4
8098
with:
8199
fetch-depth: 2
82100
- name: 📥 Download coverage data
83-
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
101+
uses: actions/download-artifact@v4
84102
with:
85103
name: coverage-data
86104
- name: 📤 Upload coverage report
87-
uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5
105+
uses: codecov/codecov-action@v5
88106
with:
89107
token: ${{ secrets.CODECOV_TOKEN }}
90108
flags: python

0 commit comments

Comments
 (0)