|
4 | 4 | name: Latest commit |
5 | 5 |
|
6 | 6 | env: |
7 | | - CACHE_VERSION: 2 |
| 7 | + CACHE_VERSION: 3 |
8 | 8 | DEFAULT_PYTHON: "3.14" |
9 | | - PRE_COMMIT_HOME: ~/.cache/pre-commit |
10 | 9 | VENV: venv |
11 | 10 |
|
12 | 11 | on: |
@@ -45,15 +44,15 @@ jobs: |
45 | 44 | needs: cache |
46 | 45 | name: Prepare |
47 | 46 | steps: |
48 | | - - name: Prepare code checkout and python/pre-commit setup |
| 47 | + - name: Prepare code checkout and python/prek(pre-commit) setup |
49 | 48 | id: cache-reuse |
50 | 49 | uses: plugwise/gh-actions/prepare-python-and-code@v2 |
51 | 50 | with: |
52 | 51 | cache-key: ${{ needs.cache.outputs.cache-key }} |
53 | 52 | fail-on-miss: false # First time create cache (if not already exists) |
54 | 53 | python-version: ${{ needs.cache.outputs.python-version }} |
55 | 54 | venv-dir: ${{ env.VENV }} |
56 | | - precommit-home: ${{ env.PRE_COMMIT_HOME }} |
| 55 | + prek-home: ${{ env.PREK_HOME }} |
57 | 56 |
|
58 | 57 | ruff: |
59 | 58 | runs-on: ubuntu-latest |
|
73 | 72 | cache-key: ${{ needs.cache.outputs.cache-key }} |
74 | 73 | python-version: ${{ needs.cache.outputs.python-version }} |
75 | 74 | venv-dir: ${{ env.VENV }} |
76 | | - precommit-home: ${{ env.PRE_COMMIT_HOME }} |
| 75 | + prek-home: ${{ env.PREK_HOME }} |
77 | 76 | - name: Ruff (with fix) |
78 | 77 | run: | |
79 | 78 | . venv-${{ needs.cache.outputs.python-version }}/bin/activate |
@@ -109,20 +108,15 @@ jobs: |
109 | 108 | cache-key: ${{ needs.cache.outputs.cache-key }} |
110 | 109 | python-version: ${{ needs.cache.outputs.python-version }} |
111 | 110 | venv-dir: ${{ env.VENV }} |
112 | | - precommit-home: ${{ env.PRE_COMMIT_HOME }} |
| 111 | + prek-home: ${{ env.PREK_HOME }} |
113 | 112 | - name: Verify commit |
114 | 113 | run: | |
115 | 114 | . venv-${{ needs.cache.outputs.python-version }}/bin/activate |
116 | | - pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual pylint |
117 | | - - name: Biome lint |
118 | | - run: | |
119 | | - . venv-${{ needs.cache.outputs.python-version }}/bin/activate |
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 | | - pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual biome |
| 115 | + prek run --show-diff-on-failure --color=always --all-files --hook-stage manual pylint |
122 | 116 | - name: Lint markdown files |
123 | 117 | run: | |
124 | 118 | . venv-${{ needs.cache.outputs.python-version }}/bin/activate |
125 | | - pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual markdownlint |
| 119 | + prek run --show-diff-on-failure --color=always --all-files --hook-stage manual pymarkdown |
126 | 120 |
|
127 | 121 | pytest: |
128 | 122 | runs-on: ubuntu-latest |
@@ -150,7 +144,7 @@ jobs: |
150 | 144 | cache-key: ${{ needs.cache.outputs.cache-key }} |
151 | 145 | python-version: ${{ steps.python.outputs.python-version }} # Force to installed python minor |
152 | 146 | venv-dir: ${{ env.VENV }} |
153 | | - precommit-home: ${{ env.PRE_COMMIT_HOME }} |
| 147 | + prek-home: ${{ env.PREK_HOME }} |
154 | 148 | - name: Run all tests |
155 | 149 | run: | |
156 | 150 | . venv-${{ steps.python.outputs.python-version }}/bin/activate |
@@ -182,7 +176,7 @@ jobs: |
182 | 176 | cache-key: ${{ needs.cache.outputs.cache-key }} |
183 | 177 | python-version: ${{ needs.cache.outputs.python-version }} |
184 | 178 | venv-dir: ${{ env.VENV }} |
185 | | - precommit-home: ${{ env.PRE_COMMIT_HOME }} |
| 179 | + prek-home: ${{ env.PREK_HOME }} |
186 | 180 | - name: Run mypy |
187 | 181 | run: | |
188 | 182 | . venv-${{ needs.cache.outputs.python-version }}/bin/activate |
@@ -227,7 +221,7 @@ jobs: |
227 | 221 | cache-key: ${{ needs.cache.outputs.cache-key }} |
228 | 222 | python-version: ${{ needs.cache.outputs.python-version }} |
229 | 223 | venv-dir: ${{ env.VENV }} |
230 | | - precommit-home: ${{ env.PRE_COMMIT_HOME }} |
| 224 | + prek-home: ${{ env.PREK_HOME }} |
231 | 225 | - name: Download all coverage artifacts |
232 | 226 | uses: actions/download-artifact@v7 |
233 | 227 | with: |
@@ -309,7 +303,7 @@ jobs: |
309 | 303 | cache-key: ${{ needs.cache.outputs.cache-key }} |
310 | 304 | python-version: ${{ needs.cache.outputs.python-version }} |
311 | 305 | venv-dir: ${{ env.VENV }} |
312 | | - precommit-home: ${{ env.PRE_COMMIT_HOME }} |
| 306 | + prek-home: ${{ env.PREK_HOME }} |
313 | 307 | - name: Run complexity report (click to view details) |
314 | 308 | run: | |
315 | 309 | . venv-${{ needs.cache.outputs.python-version }}/bin/activate |
|
0 commit comments