44name : Latest commit
55
66env :
7- CACHE_VERSION : 5
8- DEFAULT_PYTHON : " 3.13 "
7+ CACHE_VERSION : 6
8+ DEFAULT_PYTHON : " 3.14 "
99 PRE_COMMIT_HOME : ${{ github.workspace }}/.cache/pre-commit
1010 VENV : venv
1111
@@ -32,30 +32,25 @@ jobs:
3232 uses : actions/setup-python@v6
3333 with :
3434 python-version : ${{ env.DEFAULT_PYTHON }}
35+ - name : Fetch HA pyproject
36+ id : core-version
37+ run : wget -O ha_pyproject.toml "https://raw.githubusercontent.com/home-assistant/core/refs/heads/dev/pyproject.toml"
3538 - name : Compute cache key
3639 id : set-key
37- run : echo "cache-key=${{ runner.os }}-venv-cache-${{ env.CACHE_VERSION }}-${{ steps.python.outputs.python-version }}-${{ hashFiles('pyproject.toml', 'requirements_commit.txt', ' requirements_test.txt', '.pre-commit-config.yaml') }}" >> "$GITHUB_OUTPUT"
40+ run : echo "cache-key=${{ runner.os }}-venv-cache-${{ env.CACHE_VERSION }}-${{ steps.python.outputs.python-version }}-${{ hashFiles('pyproject.toml', 'requirements_test.txt', '.pre-commit-config.yaml') }}" >> "$GITHUB_OUTPUT"
3841
3942 # Prepare default python version environment
4043 prepare :
4144 runs-on : ubuntu-latest
4245 needs : cache
4346 name : Prepare
4447 steps :
45- - name : Check out committed code
46- uses : actions/checkout@v5
47- - name : Set up Python ${{ needs.cache.outputs.python-version }}
48- id : python
49- uses : actions/setup-python@v6
50- with :
51- python-version : ${{ needs.cache.outputs.python-version }}
52- - name : Create or reuse cache
48+ - name : Prepare code checkout and python/pre-commit setup
5349 id : cache-reuse
54- uses : ./.github/ actions/restore-venv
50+ uses : plugwise/gh- actions/prepare-python-and-code@v1
5551 with :
56- cache-key : ${{ needs.cache.outputs.cache-key }}
57- fail-on-miss : false # First time create cache (if not already exists)
58- python-version : ${{ steps.python.outputs.python-version }}
52+ fail-on-miss : false # First time create cache (if not already exists)
53+ python-version : ${{ needs.python.outputs.python-version }}
5954 venv-dir : ${{ env.VENV }}
6055 precommit-home : ${{ env.PRE_COMMIT_HOME }}
6156
@@ -70,20 +65,15 @@ jobs:
7065 uses : actions/checkout@v5
7166 with :
7267 persist-credentials : false
73- - name : Set up Python ${{ needs.cache.outputs.python-version }}
74- id : python
75- uses : actions/setup-python@v6
76- with :
77- python-version : ${{ needs.cache.outputs.python-version }}
78- - name : Create or reuse cache
68+ - name : Restore cached environment
7969 id : cache-reuse
80- uses : ./.github/ actions/restore-venv
70+ uses : plugwise/gh- actions/restore-venv@v1
8171 with :
8272 cache-key : ${{ needs.cache.outputs.cache-key }}
83- python-version : ${{ steps .python.outputs.python-version }}
73+ python-version : ${{ needs .python.outputs.python-version }}
8474 venv-dir : ${{ env.VENV }}
8575 precommit-home : ${{ env.PRE_COMMIT_HOME }}
86- - name : Ruff (check )
76+ - name : Ruff (with fix )
8777 run : |
8878 . venv/bin/activate
8979 ruff check plugwise_usb/ tests/
@@ -111,17 +101,12 @@ jobs:
111101 steps :
112102 - name : Check out committed code
113103 uses : actions/checkout@v5
114- - name : Set up Python ${{ needs.cache.outputs.python-version }}
115- id : python
116- uses : actions/setup-python@v6
117- with :
118- python-version : ${{ needs.cache.outputs.python-version }}
119- - name : Create or reuse cache
104+ - name : Restore cached environment
120105 id : cache-reuse
121- uses : ./.github/actions/ restore-venv
106+ uses : plugwise/ghactions/ restore-venv@v1
122107 with :
123108 cache-key : ${{ needs.cache.outputs.cache-key }}
124- python-version : ${{ steps .python.outputs.python-version }}
109+ python-version : ${{ needs .python.outputs.python-version }}
125110 venv-dir : ${{ env.VENV }}
126111 precommit-home : ${{ env.PRE_COMMIT_HOME }}
127112 - name : Verify commit
@@ -131,7 +116,7 @@ jobs:
131116# - name: Biome lint
132117# run: |
133118# . venv/bin/activate
134- # mkdir -p ./tmp && curl -sL "https://github.com/biomejs/biome/releases/download/%40biomejs%2Fbiome%402.0.0 /biome-linux-x64" -o ./tmp/biome && chmod +x ./tmp/biome
119+ # mkdir -p ./tmp && curl -sL "https://github.com/biomejs/biome/releases/latest/download /biome-linux-x64" -o ./tmp/biome && chmod +x ./tmp/biome
135120# pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual biome
136121 - name : Lint markdown files
137122 run : |
@@ -147,22 +132,17 @@ jobs:
147132 - commitcheck
148133 strategy :
149134 matrix :
150- python-version : ["3.13"]
135+ python-version : ["3.14", "3. 13"]
151136 steps :
152137 - name : Check out committed code
153138 uses : actions/checkout@v5
154- - name : Set up Python ${{ matrix.python-version }}
155- id : python
156- uses : actions/setup-python@v6
157- with :
158- python-version : ${{ matrix.python-version }}
159- - name : Create or reuse cache
139+ - name : Restore cached environment
160140 id : cache-reuse
161- uses : ./.github/actions/ restore-venv
141+ uses : plugwise/ghactions/ restore-venv@v1
162142 with :
143+ fail-on-miss : false # First time create cache (if not already exists)
163144 cache-key : ${{ needs.cache.outputs.cache-key }}-pytest-matrix-${{ matrix.python-version }}
164- fail-on-miss : false # First time create cache (if not already exists)
165- python-version : ${{ steps.python.outputs.python-version }} # Force to installed python minor
145+ python-version : ${{ needs.python.outputs.python-version }} # Force to installed python minor
166146 venv-dir : ${{ env.VENV }}
167147 precommit-home : ${{ env.PRE_COMMIT_HOME }}
168148 - name : Run all tests
@@ -190,17 +170,12 @@ jobs:
190170 uses : actions/checkout@v5
191171 with :
192172 persist-credentials : false
193- - name : Set up Python ${{ needs.cache.outputs.python-version }}
194- id : python
195- uses : actions/setup-python@v6
196- with :
197- python-version : ${{ needs.cache.outputs.python-version }}
198- - name : Create or reuse cache
173+ - name : Restore cached environment
199174 id : cache-reuse
200175 uses : ./.github/actions/restore-venv
201176 with :
202177 cache-key : ${{ needs.cache.outputs.cache-key }}
203- python-version : ${{ steps .python.outputs.python-version }}
178+ python-version : ${{ needs .python.outputs.python-version }}
204179 venv-dir : ${{ env.VENV }}
205180 precommit-home : ${{ env.PRE_COMMIT_HOME }}
206181 - name : Run mypy
@@ -240,17 +215,12 @@ jobs:
240215 steps :
241216 - name : Check out committed code
242217 uses : actions/checkout@v5
243- - name : Set up Python ${{ needs.cache.outputs.python-version }}
244- id : python
245- uses : actions/setup-python@v6
246- with :
247- python-version : ${{ needs.cache.outputs.python-version }}
248- - name : Create or reuse cache
218+ - name : Restore cached environment
249219 id : cache-reuse
250- uses : ./.github/ actions/restore-venv
220+ uses : plugwise/gh- actions/restore-venv@v1
251221 with :
252222 cache-key : ${{ needs.cache.outputs.cache-key }}
253- python-version : ${{ steps .python.outputs.python-version }}
223+ python-version : ${{ needs .python.outputs.python-version }}
254224 venv-dir : ${{ env.VENV }}
255225 precommit-home : ${{ env.PRE_COMMIT_HOME }}
256226 - name : Download all coverage artifacts
@@ -333,21 +303,16 @@ jobs:
333303 steps :
334304 - name : Check out committed code
335305 uses : actions/checkout@v5
336- - name : Set up Python ${{ needs.cache.outputs.python-version }}
337- id : python
338- uses : actions/setup-python@v6
339- with :
340- python-version : ${{ needs.cache.outputs.python-version }}
341- - name : Create or reuse cache
306+ - name : Restore cached environment
342307 id : cache-reuse
343- uses : ./.github/ actions/restore-venv
308+ uses : plugwise/gh- actions/restore-venv@v1
344309 with :
345310 cache-key : ${{ needs.cache.outputs.cache-key }}
346- python-version : ${{ steps .python.outputs.python-version }}
311+ python-version : ${{ needs .python.outputs.python-version }}
347312 venv-dir : ${{ env.VENV }}
348313 precommit-home : ${{ env.PRE_COMMIT_HOME }}
349314 - name : Run complexity report (click to view details)
350315 run : |
351316 . venv/bin/activate
352317 echo "Showing complexity higher or equal to 'C'"
353- radon cc plugwise / tests/ -s -nc --no-assert
318+ radon cc plugwise_usb / tests/ -s -nc --no-assert
0 commit comments