ci: use pre-seeded toolcache for uv, fall back to setup-uv
This commit is contained in:
@@ -21,7 +21,19 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Enable uv from toolcache
|
||||
id: uv
|
||||
run: |
|
||||
uv_path="$(find /opt/hostedtoolcache/uv -maxdepth 4 -type f -name uv -perm -111 2>/dev/null | head -1)"
|
||||
if [ -n "$uv_path" ]; then
|
||||
dirname "$uv_path" >> "$GITHUB_PATH"
|
||||
echo "found=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "uv not found in toolcache"
|
||||
fi
|
||||
|
||||
- name: Install uv
|
||||
if: steps.uv.outputs.found != 'true'
|
||||
uses: astral-sh/setup-uv@v3
|
||||
with:
|
||||
enable-cache: true
|
||||
@@ -72,7 +84,19 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Enable uv from toolcache
|
||||
id: uv
|
||||
run: |
|
||||
uv_path="$(find /opt/hostedtoolcache/uv -maxdepth 4 -type f -name uv -perm -111 2>/dev/null | head -1)"
|
||||
if [ -n "$uv_path" ]; then
|
||||
dirname "$uv_path" >> "$GITHUB_PATH"
|
||||
echo "found=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "uv not found in toolcache"
|
||||
fi
|
||||
|
||||
- name: Install uv
|
||||
if: steps.uv.outputs.found != 'true'
|
||||
uses: astral-sh/setup-uv@v3
|
||||
with:
|
||||
enable-cache: true
|
||||
|
||||
Reference in New Issue
Block a user