Skip to content

Commit fe59f7e

Browse files
committed
Update ci-setup action
1 parent b23fd4d commit fe59f7e

File tree

1 file changed

+38
-27
lines changed

1 file changed

+38
-27
lines changed
Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,56 @@
1-
name: CI setup
2-
1+
name: Setup Python and Poetry
2+
author: Renumics GmbH
3+
description: Set up Python and Poetry environment, cache/restore dependencies
34
inputs:
45
os:
56
description: "OS"
67
required: true
78
python-version:
8-
description: "The python version to install and setup"
9+
description: "Python version to set up"
910
required: true
1011
poetry-version:
11-
description: "The poetry version to install and setup"
12+
description: "Poetry version to set up"
1213
default: "2.2.1"
13-
1414
runs:
1515
using: composite
1616
steps:
17+
- name: Set up Poetry ${{ inputs.poetry-version }}
18+
run: |
19+
pipx install 'poetry==${{ inputs.poetry-version }}'
20+
pipx inject poetry poetry-dynamic-versioning
21+
shell: bash
1722
- name: Set up Python ${{ inputs.python-version }}
23+
id: setup-python
1824
uses: actions/setup-python@v6
1925
with:
2026
python-version: ${{ inputs.python-version }}
21-
- name: Install Poetry ${{ inputs.poetry-version }}
22-
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a
23-
with:
24-
virtualenvs-create: true
25-
virtualenvs-in-project: true
26-
version: ${{ inputs.poetry-version }}
27-
- name: add poetry to windows path
28-
if: runner.os == 'Windows'
29-
run: echo "C:/Users/runneradmin/.local/bin" >> $GITHUB_PATH
30-
shell: bash
31-
- name: add dynamic versioning
32-
run: poetry self add "poetry-dynamic-versioning[plugin]"
33-
shell: bash
34-
- name: Cache Packages
35-
id: poetry-cache
36-
uses: actions/cache@v4
37-
with:
38-
path: |
39-
.venv
40-
poetry.lock
41-
key: poetry-${{ inputs.os }}-${{ inputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('.github/workflows/*.yml') }}
27+
cache: poetry
28+
# - name: Install Poetry ${{ inputs.poetry-version }}
29+
# uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a
30+
# with:
31+
# virtualenvs-create: true
32+
# virtualenvs-in-project: true
33+
# version: ${{ inputs.poetry-version }}
34+
# - name: add poetry to windows path
35+
# if: runner.os == 'Windows'
36+
# run: echo "C:/Users/runneradmin/.local/bin" >> $GITHUB_PATH
37+
# shell: bash
38+
# - name: add dynamic versioning
39+
# run: poetry self add "poetry-dynamic-versioning[plugin]"
40+
# shell: bash
41+
# - name: Cache Packages
42+
# id: poetry-cache
43+
# uses: actions/cache@v4
44+
# with:
45+
# path: |
46+
# .venv
47+
# poetry.lock
48+
# key: poetry-${{ inputs.os }}-${{ inputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('.github/workflows/*.yml') }}
49+
# - name: Install dependencies
50+
# if: steps.poetry-cache.outputs.cache-hit != 'true'
51+
# run: poetry sync --no-interaction
52+
# shell: bash
4253
- name: Install dependencies
43-
if: steps.poetry-cache.outputs.cache-hit != 'true'
54+
if: steps.setup-python.outputs.cache-hit != 'true'
4455
run: poetry sync --no-interaction
4556
shell: bash

0 commit comments

Comments
 (0)