setup-uv/action.yml
Kevin Stillhammer aadfaf08d6
Change default cache-dependency-glob (#352)
To support more users by default we should support popular dependency
file formats. A quick GitHub search shows ~40k uses of `constraint.txt`
and ~16k uses of `requirements.in`.

Closes: #261
2025-04-24 15:18:27 +02:00

74 lines
2.3 KiB
YAML

name: "astral-sh/setup-uv"
description:
"Set up your GitHub Actions workflow with a specific version of uv."
author: "astral-sh"
inputs:
version:
description: "The version of uv to install e.g., `0.5.0` Defaults to the version in pyproject.toml or 'latest'."
default: ""
python-version:
description: "The version of Python to set UV_PYTHON to"
required: false
activate-environment:
description: "Use uv venv to activate a venv ready to be used by later steps. "
default: "false"
working-directory:
description: "The directory to execute all commands in and look for files such as pyproject.toml"
default: ${{ github.workspace }}
checksum:
description: "The checksum of the uv version to install"
required: false
github-token:
description:
"Used to increase the rate limit when retrieving versions and downloading uv."
required: false
default: ${{ github.token }}
enable-cache:
description: "Enable uploading of the uv cache"
default: "auto"
cache-dependency-glob:
description:
"Glob pattern to match files relative to the repository root to control
the cache."
default: |
**/*(requirements|constraints)*.(txt|in)
**/pyproject.toml
**/uv.lock
cache-suffix:
description: "Suffix for the cache key"
required: false
cache-local-path:
description: "Local path to store the cache."
default: ""
prune-cache:
description: "Prune cache before saving."
default: "true"
ignore-nothing-to-cache:
description: "Ignore when nothing is found to cache."
default: "false"
ignore-empty-workdir:
description: "Ignore when the working directory is empty."
default: "false"
tool-dir:
description: "Custom path to set UV_TOOL_DIR to."
required: false
tool-bin-dir:
description: "Custom path to set UV_TOOL_BIN_DIR to."
required: false
outputs:
uv-version:
description: "The installed uv version. Useful when using latest."
uv-path:
description: "The path to the installed uv binary."
uvx-path:
description: "The path to the installed uvx binary."
cache-hit:
description: "A boolean value to indicate a cache entry was found"
runs:
using: "node20"
main: "dist/setup/index.js"
post: "dist/save-cache/index.js"
post-if: success()
branding:
icon: "package"
color: "black"