-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathaction.yml
More file actions
40 lines (35 loc) · 1.12 KB
/
action.yml
File metadata and controls
40 lines (35 loc) · 1.12 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
name: install_python_packages
description: 'Install specified Python packages in a virtual environment'
inputs:
packages:
description: 'A space-separated list of Python packages to install.'
required: true
python-version:
description: 'The Python version to use (e.g., 3.12).'
required: true
venv-path:
description: 'The path where the virtual environment should be created.'
required: false
default: '.venv'
use-sudo:
description: 'Whether to use sudo for installation commands.'
required: false
default: 'true'
runs:
using: composite
steps:
- name: Install required APT packages
uses: ./.github/actions/install_apt_packages
with:
packages: "python${{ inputs.python-version }}-venv"
use-sudo: ${{ inputs.use-sudo }}
use-update: "false"
- name: Setup environment
run: |
python${{ inputs.python-version }} -m venv ${{ inputs.venv-path }}
echo PATH=${GITHUB_WORKSPACE}/.venv/bin:$PATH >> $GITHUB_ENV
shell: bash
- name: Install Python packages
run: |
pip install ${{ inputs.packages }}
shell: bash