-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
30 lines (29 loc) · 1.03 KB
/
action.yml
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
name: Setup Pipenv virtual environment with dependencies
description: Sets up python & pipenv, activates a virtual environment with all dependencies from Pipfile.lock
inputs:
python-version:
description: The version of Python to use
required: true
additional-dependencies:
description: Extra dependencies that need to be installed but may or may not be in Pipfile.lock
required: false
default: ""
runs:
using: "composite"
steps:
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
cache: "pipenv"
- name: Install dependencies and activate virtual environment
shell: bash
run: |
pip install pipenv
pipenv sync --dev --python ${{ inputs.python-version }}
source `pipenv --venv`/bin/activate
if [[ $ADD ]] ; then pip install $ADD ; fi
echo "PATH=${PATH}" >> $GITHUB_ENV
echo "VIRTUAL_ENV=${VIRTUAL_ENV}" >> $GITHUB_ENV
env:
ADD: ${{ inputs.additional-dependencies }}