From ed70c6b046098b536255519e76cb023d866f5be2 Mon Sep 17 00:00:00 2001 From: Martin Schmitt Date: Fri, 16 Jun 2023 10:12:48 +0200 Subject: [PATCH] added action code --- action.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 action.yml diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..e1ed6f2 --- /dev/null +++ b/action.yml @@ -0,0 +1,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 }}