Skip to content

Fix GH Actions workflow #29

Fix GH Actions workflow

Fix GH Actions workflow #29

name: Python package Lint+Test
on:
push:
branches: [ "master", "dev" ]
pull_request:
branches: [ "master", "dev" ]
env:
PYTHON_VERSION: "3.12"
POETRY_VERSION: "1.8.3"
POETRY_URL: https://install.python-poetry.org
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
id: setup_python
- name: Cache Poetry cache
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: poetry-cache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ env.POETRY_VERSION }}
- name: Cache Packages
uses: actions/cache@v4
with:
path: ~/.local
key: poetry-local-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('.github/workflows/*.yml') }}
- name: Install Poetry
run: |
curl -sSL ${{ env.POETRY_URL }} | python3 - --version ${{ env.POETRY_VERSION }}
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
poetry lock --no-update
poetry install --with dev,test
- name: Lint
run: make lint
- name: Test with pytest
run: make test