Skip to content

Merge pull request #24 from aaghamohammadi/aaghamohammadi-patch-2 #106

Merge pull request #24 from aaghamohammadi/aaghamohammadi-patch-2

Merge pull request #24 from aaghamohammadi/aaghamohammadi-patch-2 #106

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"}
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 }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
if: matrix.python-version == '3.10'