|
37 | 37 | run: wget -O ha_pyproject.toml "https://raw.githubusercontent.com/home-assistant/core/refs/heads/dev/pyproject.toml" |
38 | 38 | - name: Compute cache key |
39 | 39 | id: set-key |
40 | | - run: echo "cache-key=${{ runner.os }}-venv-cache-${{ env.CACHE_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" |
41 | 41 |
|
42 | 42 | # Prepare default python version environment |
43 | 43 | prepare: |
@@ -76,12 +76,12 @@ jobs: |
76 | 76 | precommit-home: ${{ env.PRE_COMMIT_HOME }} |
77 | 77 | - name: Ruff (with fix) |
78 | 78 | run: | |
79 | | - . venv/bin/activate |
| 79 | + . venv-${{ needs.cache.outputs.python-version }}/bin/activate |
80 | 80 | ruff check plugwise/ tests/ |
81 | 81 | - name: If needed, commit ruff changes to the pull request |
82 | 82 | if: failure() |
83 | 83 | run: | |
84 | | - . venv/bin/activate |
| 84 | + . venv-${{ needs.cache.outputs.python-version }}/bin/activate |
85 | 85 | ruff format plugwise/ tests/ |
86 | 86 | git config --global user.name 'autoruff' |
87 | 87 | git config --global user.email 'plugwise@users.noreply.github.com' |
@@ -112,16 +112,16 @@ jobs: |
112 | 112 | precommit-home: ${{ env.PRE_COMMIT_HOME }} |
113 | 113 | - name: Verify commit |
114 | 114 | run: | |
115 | | - . venv/bin/activate |
| 115 | + . venv-${{ needs.cache.outputs.python-version }}/bin/activate |
116 | 116 | pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual pylint |
117 | 117 | - name: Biome lint |
118 | 118 | run: | |
119 | | - . venv/bin/activate |
| 119 | + . venv-${{ needs.cache.outputs.python-version }}/bin/activate |
120 | 120 | mkdir -p ./tmp && curl -sL "https://github.com/biomejs/biome/releases/latest/download/biome-linux-x64" -o ./tmp/biome && chmod +x ./tmp/biome |
121 | 121 | pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual biome |
122 | 122 | - name: Lint markdown files |
123 | 123 | run: | |
124 | | - . venv/bin/activate |
| 124 | + . venv-${{ needs.cache.outputs.python-version }}/bin/activate |
125 | 125 | pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual markdownlint |
126 | 126 |
|
127 | 127 | pytest: |
@@ -153,7 +153,7 @@ jobs: |
153 | 153 | precommit-home: ${{ env.PRE_COMMIT_HOME }} |
154 | 154 | - name: Run all tests |
155 | 155 | run: | |
156 | | - . venv/bin/activate |
| 156 | + . venv-${{ needs.cache.outputs.python-version }}/bin/activate |
157 | 157 | pytest --log-level info tests/*.py --cov='.' |
158 | 158 | - name: Upload coverage artifact |
159 | 159 | uses: actions/upload-artifact@v4 |
@@ -185,7 +185,7 @@ jobs: |
185 | 185 | precommit-home: ${{ env.PRE_COMMIT_HOME }} |
186 | 186 | - name: Run mypy |
187 | 187 | run: | |
188 | | - . venv/bin/activate |
| 188 | + . venv-${{ needs.cache.outputs.python-version }}/bin/activate |
189 | 189 | pip list | grep -i mypy |
190 | 190 | mypy plugwise/ |
191 | 191 |
|
@@ -236,7 +236,7 @@ jobs: |
236 | 236 | path: ${{ github.workspace }}/artifacts |
237 | 237 | - name: Combine coverage results |
238 | 238 | run: | |
239 | | - . venv/bin/activate |
| 239 | + . venv-${{ needs.cache.outputs.python-version }}/bin/activate |
240 | 240 | coverage combine artifacts/.coverage* |
241 | 241 | coverage report --fail-under=94 |
242 | 242 | coverage xml |
@@ -312,6 +312,6 @@ jobs: |
312 | 312 | precommit-home: ${{ env.PRE_COMMIT_HOME }} |
313 | 313 | - name: Run complexity report (click to view details) |
314 | 314 | run: | |
315 | | - . venv/bin/activate |
| 315 | + . venv-${{ needs.cache.outputs.python-version }}/bin/activate |
316 | 316 | echo "Showing complexity higher or equal to 'C'" |
317 | 317 | radon cc plugwise/ tests/ -s -nc --no-assert |
0 commit comments