2025-02-05 13:43:43 +01:00
|
|
|
---
|
|
|
|
name: code-testing
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2025-02-05 13:47:36 +01:00
|
|
|
pull_request:
|
2025-02-05 13:43:43 +01:00
|
|
|
types: [assigned, opened, synchronize, reopened]
|
|
|
|
|
|
|
|
jobs:
|
2025-02-05 13:50:07 +01:00
|
|
|
|
|
|
|
pre-commit:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2025-02-05 13:51:38 +01:00
|
|
|
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
2025-02-05 13:50:07 +01:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2025-02-05 13:50:35 +01:00
|
|
|
- uses: actions/setup-python@v5
|
2025-02-05 13:50:07 +01:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
2025-02-05 13:52:40 +01:00
|
|
|
- uses: pre-commit-ci/lite-action@v1.1.0
|
2025-02-05 13:50:07 +01:00
|
|
|
|
2025-02-05 13:43:43 +01:00
|
|
|
compiling:
|
|
|
|
name: Run installation process and code compilation supported Python versions
|
|
|
|
runs-on: ubuntu-latest
|
2025-02-05 13:50:07 +01:00
|
|
|
needs: [pre-commit]
|
2025-02-05 13:43:43 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2025-02-05 13:51:38 +01:00
|
|
|
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
2025-02-05 13:43:43 +01:00
|
|
|
|
|
|
|
steps:
|
2025-02-05 13:50:07 +01:00
|
|
|
- uses: actions/checkout@v4
|
2025-02-05 13:43:43 +01:00
|
|
|
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
2025-02-05 13:50:35 +01:00
|
|
|
uses: actions/setup-python@v5
|
2025-02-05 13:43:43 +01:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
|
|
|
|
- name: install requirements
|
|
|
|
run: |
|
|
|
|
pip install .
|
|
|
|
|
|
|
|
- name: install dev requirements
|
|
|
|
run: pip install .[dev]
|
|
|
|
|
|
|
|
- name: validate the syntax of python scripts
|
|
|
|
run: |
|
|
|
|
python -m py_compile $(git ls-files '*.py')
|
|
|
|
|
|
|
|
linting:
|
|
|
|
name: Run flake8, pylint for supported Python versions
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [compiling]
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2025-02-05 13:51:38 +01:00
|
|
|
python: ["3.8", "3.9", "3.10", "3.11"]
|
2025-02-05 13:43:43 +01:00
|
|
|
|
|
|
|
steps:
|
2025-02-05 13:50:07 +01:00
|
|
|
- uses: actions/checkout@v4
|
2025-02-05 13:43:43 +01:00
|
|
|
|
|
|
|
- name: Setup Python
|
2025-02-05 13:50:35 +01:00
|
|
|
uses: actions/setup-python@v5
|
2025-02-05 13:43:43 +01:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python }}
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pip install tox tox-gh-actions
|
|
|
|
|
|
|
|
- name: "Run tox for ${{ matrix.python }}"
|
|
|
|
run: tox -e lint
|
|
|
|
|
|
|
|
typing:
|
|
|
|
name: Run mypy for supported Python versions
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [compiling]
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2025-02-05 13:51:38 +01:00
|
|
|
python: ["3.8", "3.9", "3.10", "3.11"]
|
2025-02-05 13:43:43 +01:00
|
|
|
|
|
|
|
steps:
|
2025-02-05 13:50:07 +01:00
|
|
|
- uses: actions/checkout@v4
|
2025-02-05 13:43:43 +01:00
|
|
|
|
|
|
|
- name: Setup Python
|
2025-02-05 13:50:35 +01:00
|
|
|
uses: actions/setup-python@v5
|
2025-02-05 13:43:43 +01:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python }}
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pip install tox tox-gh-actions
|
|
|
|
|
|
|
|
- name: "Run tox for ${{ matrix.python }}"
|
|
|
|
run: tox -e type
|
|
|
|
|
|
|
|
pytest:
|
|
|
|
name: Run pytest validation
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [linting, typing]
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2025-02-05 13:51:38 +01:00
|
|
|
python: ["3.8", "3.9", "3.10", "3.11"]
|
2025-02-05 13:43:43 +01:00
|
|
|
|
|
|
|
steps:
|
2025-02-05 13:50:07 +01:00
|
|
|
- uses: actions/checkout@v4
|
2025-02-05 13:43:43 +01:00
|
|
|
|
|
|
|
- name: Setup Python
|
2025-02-05 13:50:35 +01:00
|
|
|
uses: actions/setup-python@v5
|
2025-02-05 13:43:43 +01:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python }}
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pip install tox tox-gh-actions
|
|
|
|
|
|
|
|
- name: "Run tox for ${{ matrix.python }}"
|
2025-02-05 13:47:36 +01:00
|
|
|
# run: tox -e testenv
|
|
|
|
run: tox
|