Skip to content

Commit

Permalink
fix(ci): fix bad use of poetry groups (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyclimse authored Jul 22, 2024
1 parent 493390d commit 451f6ca
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
8 changes: 6 additions & 2 deletions .github/actions/setup-poetry/action.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
---
name: Set up poetry

description: Install poetry and python dependencies

inputs:
groups:
description: "Poetry dependencies groups."
required: true
python-version:
description: "Python version."
required: true

runs:
using: "composite"
steps:
Expand All @@ -29,9 +33,9 @@ runs:
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ inputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-${{ inputs.groups }}
key: venv-${{ inputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install Poetry dependencies
shell: bash
run: poetry install --no-interaction --no-root --only main,${{ inputs.groups }}
run: poetry install --no-interaction --no-root --only ${{ inputs.groups }}
if: steps.cache-deps.outputs.cache-hit != 'true'
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Set up Poetry
uses: ./.github/actions/setup-poetry
with:
groups: test
groups: main,test
python-version: ${{ matrix.python-version }}

- name: Print versions
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

name: python-publish

on:
Expand All @@ -15,17 +14,17 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up python 3.11
- name: Set up python 3.12
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: "3.12"

- name: Set up Poetry
uses: ./.github/actions/setup-poetry
with:
groups: '' # will only install the main group
python-version: '3.11'
groups: main
python-version: "3.12"

- name: Publish package
run: poetry publish --build
Expand Down

0 comments on commit 451f6ca

Please sign in to comment.