Skip to content

Add new GitHub Actions workflow 'Quality Checks' and update tox envir… #1

Add new GitHub Actions workflow 'Quality Checks' and update tox envir…

Add new GitHub Actions workflow 'Quality Checks' and update tox envir… #1

name: Quality Checks
on:
- push
- pull_request
jobs:
format:
name: Check formatting
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install tox
run: python -m pip install tox
- name: Format with black
run: tox -e format
lint:
name: Lint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install tox
run: python -m pip install tox
- name: Run linter with flake8
run: tox -e lint
typecheck:
name: Type check
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install tox
run: python -m pip install tox
- name: Type check with mypy
run: python -m tox -e typecheck
test:
name: Test
runs-on: ubuntu-22.04
strategy:
fail-fast: false # Whether to cancel all jobs if any matrix job fails
matrix:
include:
- {python-version: "3.11", toxenv: "py311"}
- {python-version: "3.10", toxenv: "py310"}
- {python-version: "3.9", toxenv: "py39"}
- {python-version: "3.8", toxenv: "py38"}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: python -m pip install tox
- name: Execute tests with pytest
run: tox -e ${{ matrix.toxenv }}