Skip to content

Commit

Permalink
Install poetry just a single time
Browse files Browse the repository at this point in the history
  • Loading branch information
DantasB committed Oct 8, 2024
1 parent dd21361 commit 63c1a2e
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,20 @@ on:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
# This job is used to install Poetry
setup-poetry:
runs-on: ubuntu-latest
steps:
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true
outputs:
poetry-version: ${{ steps.poetry-version.outputs.version }}

# This job is used to install dependencies and run tests for each supported Python version
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
Expand Down Expand Up @@ -47,16 +60,12 @@ jobs:
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Select Poetry Python ${{ matrix.python-version }} Version
run: poetry env use ${{ matrix.python-version }}

- name: Install Python ${{ matrix.python-version }} Dependencies
- name: Install Dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

# Runs a single command using the runners shell
- name: Run all tests
run: ./runtests

run: poetry run./runtests

0 comments on commit 63c1a2e

Please sign in to comment.