-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
49 lines (40 loc) · 1.23 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: "Setup poetry dependencies"
description: "Setup Python interpreter and project dependencies."
inputs:
python-version:
description: "Version of Python interpreter to setup"
required: true
default: "3.8"
poetry-version:
description: "Version of Poetry package manager to setup"
required: true
default: "1.3.2"
runs:
using: "composite"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ inputs.python-version }}
- name: Get full Python version
id: full-python-version
shell: bash
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
- name: Cache python packages
id: cache
uses: actions/cache@v2
env:
cache-name: cache-python-packages
with:
path: |
~/.cache/pip
.venv
key: ${{ steps.full-python-version.outputs.version }}-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
shell: bash
run: |
pip install -q poetry==${{ inputs.poetry-version }}
poetry config virtualenvs.in-project true
poetry install