|
24 | 24 |
|
25 | 25 | jobs: |
26 | 26 | tests: |
27 | | - needs: prek |
28 | 27 | runs-on: ubuntu-latest |
29 | 28 | name: Pytest |
30 | 29 | strategy: |
31 | 30 | matrix: |
32 | 31 | python-version: |
| 32 | + - "3.13" |
33 | 33 | - "3.14" |
34 | 34 |
|
35 | 35 | steps: |
36 | 36 | - name: 📥 Checkout the repository |
37 | | - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 37 | + uses: actions/checkout@v4 |
38 | 38 | with: |
39 | 39 | fetch-depth: 2 |
40 | 40 | - name: 🛠️ Set up Python ${{ matrix.python-version }} |
41 | | - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 |
| 41 | + uses: actions/setup-python@v5 |
42 | 42 | with: |
43 | 43 | python-version: ${{ matrix.python-version }} |
44 | 44 | - 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 |
50 | 50 | - name: 📤 Upload coverage artifact |
51 | | - if: matrix.python-version == '3.14' |
52 | | - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 |
| 51 | + uses: actions/upload-artifact@v4 |
53 | 52 | with: |
54 | 53 | name: coverage-data |
55 | 54 | path: coverage.xml |
56 | 55 |
|
57 | | - prek: |
| 56 | + lint: |
58 | 57 | runs-on: ubuntu-latest |
59 | | - name: Prek |
| 58 | + name: Lint (ruff) |
60 | 59 | steps: |
61 | 60 | - 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 |
65 | 64 | 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 |
71 | 83 | 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 |
73 | 91 |
|
74 | 92 | coverage: |
75 | 93 | runs-on: ubuntu-latest |
76 | 94 | needs: tests |
77 | 95 | steps: |
78 | 96 | - name: 📥 Checkout the repository |
79 | | - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 97 | + uses: actions/checkout@v4 |
80 | 98 | with: |
81 | 99 | fetch-depth: 2 |
82 | 100 | - name: 📥 Download coverage data |
83 | | - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 |
| 101 | + uses: actions/download-artifact@v4 |
84 | 102 | with: |
85 | 103 | name: coverage-data |
86 | 104 | - name: 📤 Upload coverage report |
87 | | - uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5 |
| 105 | + uses: codecov/codecov-action@v5 |
88 | 106 | with: |
89 | 107 | token: ${{ secrets.CODECOV_TOKEN }} |
90 | 108 | flags: python |
|
0 commit comments