44name : Latest commit
55
66env :
7- CACHE_VERSION : 14
8- DEFAULT_PYTHON : " 3.13 "
7+ CACHE_VERSION : 2
8+ DEFAULT_PYTHON : " 3.14 "
99 PRE_COMMIT_HOME : ~/.cache/pre-commit
1010 VENV : venv
1111
2323 name : Cache identify
2424 outputs :
2525 cache-key : ${{ steps.set-key.outputs.cache-key }}
26- python-version : ${{ steps.python.outputs.python-version}} # Ensure all runners use THIS minor version
26+ python-version : ${{ steps.python.outputs.python-version }} # Ensure all runners use THIS minor version
2727 steps :
2828 - name : Check out committed code
2929 uses : actions/checkout@v5
3737 run : wget -O ha_pyproject.toml "https://raw.githubusercontent.com/home-assistant/core/refs/heads/dev/pyproject.toml"
3838 - name : Compute cache key
3939 id : set-key
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"
40+ run : echo "cache-key=${{ runner.os }}-${{ env.CACHE_VERSION }}-${{ hashFiles('pyproject.toml', 'requirements_test.txt', '.pre-commit-config.yaml') }}" >> "$GITHUB_OUTPUT"
4141
4242 # Prepare default python version environment
4343 prepare :
@@ -71,17 +71,17 @@ jobs:
7171 uses : plugwise/gh-actions/restore-venv@v1
7272 with :
7373 cache-key : ${{ needs.cache.outputs.cache-key }}
74- python-version : ${{ needs.cache.outputs.python-version}}
74+ python-version : ${{ needs.cache.outputs.python-version }}
7575 venv-dir : ${{ env.VENV }}
7676 precommit-home : ${{ env.PRE_COMMIT_HOME }}
7777 - name : Ruff (with fix)
7878 run : |
79- . venv/bin/activate
79+ . venv-${{ needs.cache.outputs.python-version }} /bin/activate
8080 ruff check plugwise/ tests/
8181 - name : If needed, commit ruff changes to the pull request
8282 if : failure()
8383 run : |
84- . venv/bin/activate
84+ . venv-${{ needs.cache.outputs.python-version }} /bin/activate
8585 ruff format plugwise/ tests/
8686 git config --global user.name 'autoruff'
8787 git config --global user.email '[email protected] ' @@ -107,21 +107,21 @@ jobs:
107107 uses : plugwise/gh-actions/restore-venv@v1
108108 with :
109109 cache-key : ${{ needs.cache.outputs.cache-key }}
110- python-version : ${{ needs.cache.outputs.python-version}}
110+ python-version : ${{ needs.cache.outputs.python-version }}
111111 venv-dir : ${{ env.VENV }}
112112 precommit-home : ${{ env.PRE_COMMIT_HOME }}
113113 - name : Verify commit
114114 run : |
115- . venv/bin/activate
115+ . venv-${{ needs.cache.outputs.python-version }} /bin/activate
116116 pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual pylint
117117 - name : Biome lint
118118 run : |
119- . venv/bin/activate
119+ . venv-${{ needs.cache.outputs.python-version }} /bin/activate
120120 mkdir -p ./tmp && curl -sL "https://github.com/biomejs/biome/releases/latest/download/biome-linux-x64" -o ./tmp/biome && chmod +x ./tmp/biome
121121 pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual biome
122122 - name : Lint markdown files
123123 run : |
124- . venv/bin/activate
124+ . venv-${{ needs.cache.outputs.python-version }} /bin/activate
125125 pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual markdownlint
126126
127127 pytest :
@@ -133,7 +133,7 @@ jobs:
133133 - commitcheck
134134 strategy :
135135 matrix :
136- python-version : ["3.13"]
136+ python-version : ["3.14", "3. 13"]
137137 steps :
138138 - name : Check out committed code
139139 uses : actions/checkout@v5
@@ -146,18 +146,19 @@ jobs:
146146 id : cache-reuse
147147 uses : plugwise/gh-actions/restore-venv@v1
148148 with :
149+ fail-on-miss : false # First time create cache (if not already exists)
149150 cache-key : ${{ needs.cache.outputs.cache-key }}
150- python-version : ${{ steps.python.outputs.python-version }} # Force to installed python minor$
151+ python-version : ${{ steps.python.outputs.python-version }} # Force to installed python minor
151152 venv-dir : ${{ env.VENV }}
152153 precommit-home : ${{ env.PRE_COMMIT_HOME }}
153154 - name : Run all tests
154155 run : |
155- . venv/bin/activate
156+ . venv-${{ steps.python.outputs.python-version }} /bin/activate
156157 pytest --log-level info tests/*.py --cov='.'
157158 - name : Upload coverage artifact
158159 uses : actions/upload-artifact@v4
159160 with :
160- name : coverage-${{ matrix .python-version }}
161+ name : coverage-${{ steps.python.outputs .python-version }}
161162 path : .coverage
162163 if-no-files-found : error
163164 include-hidden-files : true
@@ -179,12 +180,12 @@ jobs:
179180 uses : plugwise/gh-actions/restore-venv@v1
180181 with :
181182 cache-key : ${{ needs.cache.outputs.cache-key }}
182- python-version : ${{ needs.cache.outputs.python-version}}
183+ python-version : ${{ needs.cache.outputs.python-version }}
183184 venv-dir : ${{ env.VENV }}
184185 precommit-home : ${{ env.PRE_COMMIT_HOME }}
185186 - name : Run mypy
186187 run : |
187- . venv/bin/activate
188+ . venv-${{ needs.cache.outputs.python-version }} /bin/activate
188189 pip list | grep -i mypy
189190 mypy plugwise/
190191
@@ -224,7 +225,7 @@ jobs:
224225 uses : plugwise/gh-actions/restore-venv@v1
225226 with :
226227 cache-key : ${{ needs.cache.outputs.cache-key }}
227- python-version : ${{ needs.cache.outputs.python-version}}
228+ python-version : ${{ needs.cache.outputs.python-version }}
228229 venv-dir : ${{ env.VENV }}
229230 precommit-home : ${{ env.PRE_COMMIT_HOME }}
230231 - name : Download all coverage artifacts
@@ -235,7 +236,7 @@ jobs:
235236 path : ${{ github.workspace }}/artifacts
236237 - name : Combine coverage results
237238 run : |
238- . venv/bin/activate
239+ . venv-${{ needs.cache.outputs.python-version }} /bin/activate
239240 coverage combine artifacts/.coverage*
240241 coverage report --fail-under=94
241242 coverage xml
@@ -306,11 +307,11 @@ jobs:
306307 uses : plugwise/gh-actions/restore-venv@v1
307308 with :
308309 cache-key : ${{ needs.cache.outputs.cache-key }}
309- python-version : ${{ needs.cache.outputs.python-version}}
310+ python-version : ${{ needs.cache.outputs.python-version }}
310311 venv-dir : ${{ env.VENV }}
311312 precommit-home : ${{ env.PRE_COMMIT_HOME }}
312313 - name : Run complexity report (click to view details)
313314 run : |
314- . venv/bin/activate
315+ . venv-${{ needs.cache.outputs.python-version }} /bin/activate
315316 echo "Showing complexity higher or equal to 'C'"
316317 radon cc plugwise/ tests/ -s -nc --no-assert
0 commit comments