33
44name : Latest commit
55
6+ x-python-matrix : &python-matrix
7+ python-version : ["3.13"]
8+
69env :
710 CACHE_VERSION : 2
811 DEFAULT_PYTHON : " 3.13"
@@ -129,47 +132,13 @@ jobs:
129132 . venv/bin/activate
130133 pre-commit run --show-diff-on-failure --color=always --all-files --hook-stage manual markdownlint
131134
132- prepare-test-cache :
133- runs-on : ubuntu-latest
134- name : Create pytest cache for Python ${{ matrix.python-version }}
135- needs :
136- - prepare
137- - commitcheck
138- strategy :
139- matrix :
140- python-version : ["3.13"]
141- steps :
142- - name : Check out committed code
143- uses : actions/checkout@v4
144- - name : Set up Python ${{ matrix.python-version }}
145- id : python
146- uses : actions/setup-python@v5
147- with :
148- python-version : ${{ matrix.python-version }}
149- - name : Create or reuse cache
150- id : cache-reuse
151- uses : ./.github/actions/restore-venv
152- with :
153- python-version : ${{ steps.python.outputs.python-version }}
154- cache-key : ${{ runner.os }}-venv-cache-${{ env.CACHE_VERSION }}-${{ steps.python.outputs.python-version }}-${{ hashFiles('pyproject.toml', 'requirements_test.txt', '.pre-commit-config.yaml') }}
155- venv-directory : ${{ env.VENV }}
156- precommit-home : ${{ env.PRE_COMMIT_HOME }}
157- - name : Extend Python ${{ matrix.python-version }} virtual environment
158- run : |
159- python -m venv venv
160- . venv/bin/activate
161- pip install uv
162-
163135 pytest :
164136 runs-on : ubuntu-latest
165137 name : Run pytest using Python ${{ matrix.python-version }}
166138 needs :
167139 - prepare
168- - prepare-test-cache
169140 strategy :
170- matrix :
171- python-version : ["3.13"]
172-
141+ matrix : *python-matrix
173142 steps :
174143 - name : Check out committed code
175144 uses : actions/checkout@v4
@@ -182,10 +151,11 @@ jobs:
182151 id : cache-reuse
183152 uses : ./.github/actions/restore-venv
184153 with :
185- python-version : ${{ steps.python.outputs .python-version }}
186- cache-key : ${{ runner.os }}-venv-cache-${{ env.CACHE_VERSION }}-${{ steps .python.outputs.python -version }}-${{ hashFiles('pyproject.toml', 'requirements_test.txt', '.pre-commit-config.yaml') }}
154+ python-version : ${{ matrix .python-version }}
155+ cache-key : ${{ runner.os }}-venv-cache-${{ env.CACHE_VERSION }}-${{ matrix .python- -version }}-${{ hashFiles('pyproject.toml', 'requirements_test.txt', '.pre-commit-config.yaml') }}
187156 venv-directory : ${{ env.VENV }}
188157 precommit-home : ${{ env.PRE_COMMIT_HOME }}
158+ fail-on-miss : false # First time create cache (if not already exists)
189159 - name : Run all tests
190160 run : |
191161 . venv/bin/activate
0 commit comments