File tree 3 files changed +59
-27
lines changed
actions/setup-poetry-project
3 files changed +59
-27
lines changed Original file line number Diff line number Diff line change
1
+ name : Setup Poetry Project
2
+ description : " Set ups Poetry and install the project's dependencies"
3
+
4
+ inputs :
5
+ install_plugin :
6
+ description : " Whether the Poetry dynamic versioning plugin should be installed"
7
+ required : true
8
+ default : " true"
9
+
10
+
11
+ runs :
12
+ using : " composite"
13
+ steps :
14
+ - name : Install Poetry
15
+ env :
16
+ PIP_PROGRESS_BAR : " off"
17
+ PIP_DISABLE_PIP_VERSION_CHECK : " on"
18
+ shell : sh
19
+ run : |
20
+ export POETRY_HOME=$HOME/poetry
21
+ python -m venv $POETRY_HOME
22
+ $POETRY_HOME/bin/pip install poetry==1.8.3
23
+ $POETRY_HOME/bin/poetry --version
24
+ echo "$HOME/poetry/bin" >> $GITHUB_PATH
25
+
26
+ - name : Add Poetry plugin
27
+ env :
28
+ PIP_PROGRESS_BAR : " off"
29
+ PIP_DISABLE_PIP_VERSION_CHECK : " on"
30
+ POETRY_NO_INTERACTION : 1
31
+ POETRY_VIRTUALENVS_IN_PROJECT : true
32
+ shell : sh
33
+ if : ${{ inputs.install_plugin == 'true' }}
34
+ run : poetry self add "poetry-dynamic-versioning[plugin]"
35
+
36
+ - name : Install Dependencies
37
+ env :
38
+ POETRY_NO_INTERACTION : 1
39
+ POETRY_VIRTUALENVS_IN_PROJECT : true
40
+ shell : sh
41
+ run : poetry install --with dev
Original file line number Diff line number Diff line change @@ -24,17 +24,15 @@ jobs:
24
24
image : python:3.12-alpine
25
25
26
26
steps :
27
- - name : Checkout Repository
28
- uses : actions/checkout@v4
27
+ - name : Checkout Repository
28
+ uses : actions/checkout@v4
29
29
30
- - name : Install Poetry
31
- run : pip install poetry
30
+ - uses : ./.github/actions/setup-poetry-project
31
+ with :
32
+ install_plugin : false
32
33
33
- - name : Install Dependencies
34
- run : poetry install --with dev
34
+ - name : Run ruff check
35
+ run : poetry run ruff check
35
36
36
- - name : Run ruff check
37
- run : poetry run ruff check
38
-
39
- - name : Run ruff format check
40
- run : poetry run ruff format --check .
37
+ - name : Run ruff format check
38
+ run : poetry run ruff format --check .
Original file line number Diff line number Diff line change @@ -12,29 +12,22 @@ jobs:
12
12
tests :
13
13
runs-on : ubuntu-latest
14
14
env :
15
- PIP_PROGRESS_BAR : " off"
16
- PIP_DISABLE_PIP_VERSION_CHECK : " on"
17
15
POETRY_NO_INTERACTION : 1
18
- POETRY_VIRTUALENVS_CREATE : false
19
16
strategy :
20
17
matrix :
21
- python-version : ['3.11', '3.12'] # Define Python versions here
18
+ python-version : [ '3.11', '3.12' ] # Define Python versions here
22
19
23
20
container :
24
21
image : python:${{ matrix.python-version }}-alpine # Use Python Docker images
25
22
26
23
steps :
27
- - name : Checkout Repository
28
- uses : actions/checkout@v4
24
+ - name : Checkout Repository
25
+ uses : actions/checkout@v4
29
26
30
- - name : Install Poetry
31
- run : |
32
- pip install poetry
27
+ - uses : ./.github/actions/setup-poetry-project
28
+ with :
29
+ install_plugin : false
33
30
34
- - name : Install Dependencies
35
- run : |
36
- poetry install --with dev
37
-
38
- - name : Run Pytest
39
- run : |
40
- poetry run pytest
31
+ - name : Run Pytest
32
+ run : |
33
+ poetry run pytest
You can’t perform that action at this time.
0 commit comments