-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
51 lines (45 loc) · 1.51 KB
/
action.yml
File metadata and controls
51 lines (45 loc) · 1.51 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
name: "Install Python and Poetry"
author: "Marcel Arns"
description: "Set up a specific version of Poetry with specific version of Python and install dependencies"
inputs:
poetry_version:
description: "Poetry version to install"
required: true
default: "1.1.12"
python_version:
description: "Python version to use"
required: true
default: "3.10.0"
ssh_key:
description: "SSH key to use to clone private repositories"
required: false
outputs:
python-version:
description: "Python version"
value: ${{ inputs.python_version }}
runs:
using: "composite"
steps:
- uses: actions/setup-python@v2
with:
python-version: ${{ inputs.python_version }}
- name: Install and configure Poetry
shell: bash
run: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - --yes --version=${{ inputs.poetry_version }}
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Restore virtualenv from Poetry cache
uses: actions/cache@v2
id: poetry-cache
with:
path: ~/.cache/pypoetry/virtualenvs
key: poetry-${{ inputs.python_version }}-${{ hashFiles('**/poetry.lock') }}
- name: Create virtualenv and install dependencies
if: steps.poetry-cache.outputs.cache-hit != 'true'
shell: bash
run: |
if [ ! -z ${{ inputs.ssh_key }} ]; then
eval "$(ssh-agent -s)"
bash -c 'ssh-add - <<< "${{ inputs.ssh_key }}"'
fi
poetry install