2024-03-18 21:39:41 -04:00
|
|
|
name: 'Setup Python Environment'
|
|
|
|
description: 'Set up Python and install dependencies with optional configurations.'
|
|
|
|
inputs:
|
|
|
|
python-version:
|
|
|
|
description: 'Python version to set up.'
|
|
|
|
required: true
|
2024-04-02 12:47:58 -04:00
|
|
|
default: '3.10'
|
2024-03-18 21:39:41 -04:00
|
|
|
cache:
|
|
|
|
description: 'Cache dependencies. Options: pip'
|
|
|
|
required: false
|
|
|
|
default: 'pip'
|
|
|
|
requirements-type:
|
|
|
|
description: 'Type of requirements to install. Options: base, development, default'
|
|
|
|
required: false
|
|
|
|
default: 'dev'
|
|
|
|
|
|
|
|
runs:
|
|
|
|
using: 'composite'
|
|
|
|
steps:
|
|
|
|
- name: Set up Python ${{ inputs.python-version }}
|
|
|
|
uses: actions/setup-python@v5
|
|
|
|
with:
|
|
|
|
python-version: ${{ inputs.python-version }}
|
|
|
|
cache: ${{ inputs.cache }}
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
2024-03-26 02:03:47 -04:00
|
|
|
sudo apt-get update && sudo apt-get -y install libldap2-dev libsasl2-dev
|
2024-03-18 21:39:41 -04:00
|
|
|
pip install --upgrade pip setuptools wheel
|
|
|
|
if [ "${{ inputs.requirements-type }}" = "dev" ]; then
|
|
|
|
pip install -r requirements/development.txt
|
|
|
|
elif [ "${{ inputs.requirements-type }}" = "base" ]; then
|
|
|
|
pip install -r requirements/base.txt
|
|
|
|
fi
|
|
|
|
shell: bash
|