-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
44 lines (39 loc) · 1.28 KB
/
action.yml
File metadata and controls
44 lines (39 loc) · 1.28 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
name: Setup Python Environment
description: Setup Python, Poetry, and cache dependencies
inputs:
python-version:
description: Python version
required: false
default: '3.12'
install-dependencies:
description: Whether to install project dependencies
required: false
default: 'true'
runs:
using: composite
steps:
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ inputs.python-version }}
- name: Install Poetry
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
with:
version: "2.1.3"
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Cache virtualenv
if: inputs.install-dependencies == 'true'
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: .venv
key: ${{ runner.os }}-py${{ inputs.python-version }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-py${{ inputs.python-version }}-poetry-
- name: Install dependencies
if: inputs.install-dependencies == 'true'
shell: bash
run: |
poetry sync -n
poetry env info -n