Skip to content

Commit

Permalink
chore: refactor to poetry based CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Strömer committed Jun 11, 2024
1 parent e291250 commit 2567fea
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,26 @@ name: Run Python tests
on: [push, pull_request]

jobs:
build:
name: Run tests
run_tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -e .[test]
- uses: pavelzw/pytest-action@v2
python-version: "3.11"
- name: Install poetry
uses: abatilo/actions-poetry@v2
- name: Setup a local virtual environment (if no poetry.toml file)
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the dependencies lock file
with:
emoji: false
verbose: false
job-summary: true
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install the project dependencies
run: poetry install --with test
- name: Run the automated tests
run: poetry run pytest

0 comments on commit 2567fea

Please sign in to comment.