From b0a6301717f817d6826733f1e271f4f3f83229d1 Mon Sep 17 00:00:00 2001 From: Alireza Aghamohammadi Date: Sat, 9 Dec 2023 18:47:51 +0330 Subject: [PATCH] Add new GitHub Actions workflow 'Quality Checks' and update tox environment list - Created a new continuous integration workflow named 'Quality Checks' to run on 'push' and 'pull_request' events. - Added jobs for code formatting with black, linting with flake8, type checking with mypy, and testing across multiple Python versions: 3.8, 3.9, 3.10, and 3.11 using tox. - Set up matrix strategy in the testing job to run tests concurrently across the specified Python versions without cancelling all jobs if any one of them fails. - Updated `tox.ini` to include Python 3.8, 3.9, 3.10, and 3.11 in the environment list. --- .github/workflows/quality_checks.yml | 79 ++++++++++++++++++++++++++++ setup.cfg | 3 +- 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/quality_checks.yml diff --git a/.github/workflows/quality_checks.yml b/.github/workflows/quality_checks.yml new file mode 100644 index 0000000..01eb412 --- /dev/null +++ b/.github/workflows/quality_checks.yml @@ -0,0 +1,79 @@ +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 }} diff --git a/setup.cfg b/setup.cfg index 02ab908..d16b4ad 100644 --- a/setup.cfg +++ b/setup.cfg @@ -54,9 +54,10 @@ source = */site-packages/pysolorie [tox:tox] -envlist = py310 +envlist = py38, py39, py310, py311 isolated_build = True + [testenv] deps = pytest