Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: creates composite action with full poetry setup #3

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/actions/setup-poetry/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "setup-poetry"
description: "Composite action to setup poetry."

inputs:
poetry-version:
required: false
description: "The poetry version to use"
default: "1.5.1"
python-version:
required: false
description: "The python version to use"
default: "3.11"

runs:
using: "composite"
steps:
- name: Install Poetry
run: pipx install poetry==${{ inputs.poetry-version }}
shell: bash

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
cache: poetry
cache-dependency-path: poetry.lock

- name: Set Poetry environment
run: poetry env use ${{ inputs.python-version }}
shell: bash

- name: Install dependencies
run: poetry install --no-root
shell: bash

- name: Install dependencies
run: poetry install --no-interaction --no-root
shell: bash
22 changes: 5 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,9 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Set up python
uses: actions/setup-python@v4

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Set up poetry and install
uses: ./.github/actions/setup-poetry

- name: Run checks
run: make lint
Expand All @@ -55,17 +49,11 @@ jobs:
steps:
- name: Check out
uses: actions/checkout@v3

- name: Set up python
uses: actions/setup-python@v4
- name: Set up poetry and install
uses: ./.github/actions/setup-poetry
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Install dependencies
run: poetry install --no-interaction --no-root

- name: Run tests
run: make test