-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
55 lines (53 loc) · 1.83 KB
/
action.yml
File metadata and controls
55 lines (53 loc) · 1.83 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: setup-python-action
description: Setup Python and install specified dependencies
inputs:
python-version:
description: Version of python to setup
default: '3.10'
required: false
requirements-txt:
description: Relative path to requirements.txt file. Wildcards can be submitted as well
default: null
required: false
packages:
description: Space-delimited pip packages to be installed
default: null
required: false
pip-install-args:
description: Additional arguments to add to the pip install command
default: null
required: false
build-command:
description: Build command to be executed after installation, if needed
default: null
required: false
runs:
using: composite
steps:
- name: Set up Python version ${{ inputs.python-version }} (requirements.txt cache)
if: ${{ inputs.requirements-txt }}
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
cache: 'pip'
cache-dependency-path: ${{ inputs.requirements-txt }}
- name: Set up Python version ${{ inputs.python-version }} (no cache)
if: ${{ !inputs.requirements-txt }}
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
- name: Install build dependencies
run: pip install --upgrade wheel
shell: bash
- name: Install dependencies
if: ${{ inputs.requirements-txt }}
run: pip install `for r in ${{ inputs.requirements-txt }}; do echo "-r $r"; done` ${{ inputs.pip-install-args }}
shell: bash
- name: Install packages
if: ${{ inputs.packages }}
run: pip install ${{ inputs.packages }} ${{ inputs.pip-install-args }}
shell: bash
- name: Run build command
if: ${{ inputs.build-command }}
run: ${{ inputs.build-command }}
shell: bash