Skip to content

Merge pull request #29 from HENNGE/release-24.6 #40

Merge pull request #29 from HENNGE/release-24.6

Merge pull request #29 from HENNGE/release-24.6 #40

Workflow file for this run

name: workflow
on: [push, pull_request]
permissions:
actions: write
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
env:
PYTHON_VERSIONS: '["3.8", "3.9", "3.10", "3.11", "3.12"]'
POETRY_VERSION: 1.8.3
jobs:
# workaround since matrix can not access `env` but can access `needs`
python-versions:
runs-on: "ubuntu-latest"
outputs:
versions: ${{ steps.set-versions.outputs.versions }}
steps:
- id: set-versions
run: echo "versions=$PYTHON_VERSIONS" >> $GITHUB_OUTPUT
lock:
needs: python-versions
strategy:
matrix:
python-version: ${{ fromJSON(needs.python-versions.outputs.versions) }}
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: curl -sSL https://install.python-poetry.org | python3 -
- run: poetry lock
- uses: actions/cache@v4
with:
path: poetry.lock
key: ${{ github.sha }}-${{ matrix.python-version }}
pytest:
needs: [lock, python-versions]
strategy:
matrix:
python-version: ${{ fromJSON(needs.python-versions.outputs.versions) }}
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v4
with:
path: poetry.lock
key: ${{ github.sha }}-${{ matrix.python-version }}
- run: curl -sSL https://install.python-poetry.org | python3 -
- run: poetry install
- run: poetry run pytest --verbose
mypy:
needs: [lock, python-versions]
strategy:
matrix:
python-version: ${{ fromJSON(needs.python-versions.outputs.versions) }}
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v4
with:
path: poetry.lock
key: ${{ github.sha }}-${{ matrix.python-version }}
- run: curl -sSL https://install.python-poetry.org | python3 -
- run: poetry install
- run: poetry run mypy
isort:
needs: lock
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: actions/cache@v4
with:
path: poetry.lock
key: ${{ github.sha }}-3.12
- run: curl -sSL https://install.python-poetry.org | python3 -
- run: poetry install
- run: poetry run isort --check --diff src tests
black:
needs: lock
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: actions/cache@v4
with:
path: poetry.lock
key: ${{ github.sha }}-3.12
- run: curl -sSL https://install.python-poetry.org | python3 -
- run: poetry install
- run: poetry run black --check src/ tests/