Skip to content

Commit 553322f

Browse files
committed
trying runner cache
1 parent d00bbbf commit 553322f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/actions/python/setup/action.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,23 @@ runs:
5151
key: ${{ runner.os }}-uv-${{ hashFiles(format('{0}/uv.lock', inputs.project)) }}
5252
restore-keys: |
5353
${{ runner.os }}-uv-
54+
- shell: bash
55+
run: |
56+
# Pre-create cache directory that setup-uv expects to prevent post-job cleanup failures
57+
# setup-uv always sets UV_CACHE_DIR and tries to clean it up, even when enable-cache: false
58+
# We create it in the runner's temp directory which should persist across contexts
59+
if [[ "${{ runner.os }}" == "Windows" ]]; then
60+
CACHE_DIR="${{ runner.temp }}/setup-uv-cache"
61+
elif [[ "${{ runner.os }}" == "macOS" ]]; then
62+
CACHE_DIR="${{ runner.temp }}/setup-uv-cache"
63+
else
64+
CACHE_DIR="${{ runner.temp }}/setup-uv-cache"
65+
fi
66+
mkdir -p "$CACHE_DIR" 2>/dev/null || true
67+
# Create a marker file so the directory is recognized
68+
echo "placeholder" > "$CACHE_DIR/.placeholder" 2>/dev/null || true
69+
# Set UV_CACHE_DIR to point to our directory so setup-uv uses it
70+
echo "UV_CACHE_DIR=$CACHE_DIR" >> $GITHUB_ENV
5471
- uses: astral-sh/setup-uv@v7
5572
id: setup-uv
5673
with:

0 commit comments

Comments
 (0)