From 8206b7e96daf32deb412f0800271fe1940d12758 Mon Sep 17 00:00:00 2001 From: Amir Husayn Panahifar Date: Sat, 12 Sep 2026 14:47:37 +0330 Subject: [PATCH] ci: use pre-seeded toolcache for uv, fall back to setup-uv --- .gitea/workflows/ci.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 33129e4..d3fa133 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -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