Skip to content

Commit c4bc9ac

Browse files
committed
pytest uses other versioning
1 parent d4ca86e commit c4bc9ac

File tree

2 files changed

+8
-38
lines changed

2 files changed

+8
-38
lines changed

.github/actions/restore-venv/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ runs:
2929
if: ${{ inputs.fail-on-miss == 'true' && steps.cache-create.outputs.cache-hit != 'true' }}
3030
shell: bash
3131
run: |
32-
echo "Failed to restore cache for {{ inputs.python-version}} virtual environment from cache"
32+
echo "Failed to restore cache for ${{ inputs.python-version}} virtual environment from cache"
3333
exit 1
3434

.github/workflows/verify.yml

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
name: Latest commit
55

6+
x-python-matrix: &python-matrix
7+
python-version: ["3.13"]
8+
69
env:
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

Comments
 (0)