Action — setup-python
Installs Python with uv and restores the uv dependency cache.
Usage
yaml
steps:
- uses: actions/checkout@v4
- uses: KevinDeBenedetti/github-workflows/.github/actions/setup-python@main
with:
python-version: '3.12'Inputs
| Input | Type | Default | Description |
|---|---|---|---|
python-version | string | '3.12' | Python version to install |
working-directory | string | '.' | Directory containing pyproject.toml |
install | boolean | true | Run uv sync after setup |
Outputs
| Output | Description |
|---|---|
cache-hit | Whether the uv cache was restored |
Steps
- Install uv (latest)
- Setup Python
python-version - Restore uv cache keyed on
uv.lock - Run
uv sync --frozen
Notes
install: 'false'skips theuv syncstep — useful when you only need the Python + uv toolchain.- Cache key is scoped to
runner.os,python-version, and the hash ofuv.lock, so cache is invalidated when dependencies change.