-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathaction.yml
More file actions
37 lines (32 loc) · 1.22 KB
/
Copy pathaction.yml
File metadata and controls
37 lines (32 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Setup python
description: Setup python and install dependencies
inputs:
python-version:
description: "Python version (e.g. '3.7', '3.8.13', '3.11.0-alpha.1', '3.x')."
required: true
requirements:
description: "Optional list of arguments passed to `uv pip install` (e.g. 'numpy==1.19.5', '-r requirements.txt')."
required: false
runs:
using: composite
steps:
- uses: actions/setup-python@v5
with:
python-version: "${{ inputs.python-version }}"
# Install uv and enable its built-in cache. The cache key takes the
# platform, the uv version, and a hash of the files below into account.
# See https://docs.astral.sh/uv/guides/integration/github/ for details.
# NOTE: setup-uv publishes immutable releases only (no
# floating major tags), so we pin the full version
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
with:
enable-cache: true
cache-suffix: "py${{ inputs.python-version }}"
cache-dependency-glob: |
pyproject.toml
requirements/*.txt
- name: Install requirements
if: ${{ inputs.requirements != '' }}
shell: bash
run: uv pip install --verbose --system ${{ inputs.requirements }}