Skip to content

Commit 61cb8a9

Browse files
authored
add outputs python-version and python-cache-hit (#728)
This commit splits up the "normal" cache containing the dependencies and the "python" cache containing the python binaries. This will lead to a one-time invalidation of caches. Closes: #713
1 parent 11050ed commit 61cb8a9

File tree

10 files changed

+284
-221
lines changed

10 files changed

+284
-221
lines changed

.github/workflows/test.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ jobs:
325325
with:
326326
persist-credentials: false
327327
- name: Install latest version
328+
id: setup-uv
328329
uses: ./
329330
with:
330331
python-version: 3.13.1t
@@ -335,6 +336,14 @@ jobs:
335336
exit 1
336337
fi
337338
shell: bash
339+
- name: Verify output python-version is correct
340+
run: |
341+
if [ "$PYTHON_VERSION" != "3.13.1t" ]; then
342+
exit 1
343+
fi
344+
shell: bash
345+
env:
346+
PYTHON_VERSION: ${{ steps.setup-uv.outputs.python-version }}
338347
- run: uv sync
339348
working-directory: __tests__/fixtures/uv-project
340349

@@ -986,7 +995,7 @@ jobs:
986995
exit 1
987996
fi
988997
env:
989-
CACHE_HIT: ${{ steps.restore.outputs.cache-hit }}
998+
CACHE_HIT: ${{ steps.restore.outputs.python-cache-hit }}
990999
- run: uv sync --managed-python
9911000
working-directory: __tests__/fixtures/uv-project
9921001

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.github/copilot-instructions.md

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ Have a look under [Advanced Configuration](#advanced-configuration) for detailed
125125
- `uvx-path`: The path to the installed uvx binary.
126126
- `cache-hit`: A boolean value to indicate a cache entry was found.
127127
- `venv`: Path to the activated venv if activate-environment is true.
128+
- `python-version`: The Python version that was set.
129+
- `python-cache-hit`: A boolean value to indicate the Python cache entry was found.
128130

129131
### Python version
130132

action-types.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,7 @@ outputs:
6969
type: string
7070
venv:
7171
type: string
72+
python-version:
73+
type: string
74+
python-cache-hit:
75+
type: boolean

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ outputs:
9393
description: "The cache key used for storing/restoring the cache"
9494
venv:
9595
description: "Path to the activated venv if activate-environment is true"
96+
python-version:
97+
description: "The Python version that was set."
98+
python-cache-hit:
99+
description: "A boolean value to indicate the Python cache entry was found"
96100
runs:
97101
using: "node24"
98102
main: "dist/setup/index.js"

dist/save-cache/index.js

Lines changed: 64 additions & 79 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)