Skip to content

Commit

Permalink
Merge pull request #3 from jpower432/chore/update-poetry-setup
Browse files Browse the repository at this point in the history
chore: creates composite action with full poetry setup
  • Loading branch information
Alex Flom authored Jun 20, 2023
2 parents 4fdcb28 + 88c5bb2 commit a296e0b
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 17 deletions.
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

0 comments on commit a296e0b

Please sign in to comment.