diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b51690e..99f00e2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,3 +1,5 @@ +# Note: add all job names to the deploy-status.needs. + name: Tests on: @@ -30,6 +32,21 @@ jobs: - name: Test with tox py${{ matrix.python-version }}-${{ matrix.os }} run: tox -v + linters_checkers: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: 3.12 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install .[tests] + - name: Mypy, Flake, Bandit, Black + run: tox -e mypy,flake8,bandit,black + test_full: runs-on: ubuntu-latest steps: @@ -55,7 +72,7 @@ jobs: # This allows us to have a branch protection rule this entire workflow deploy-status: runs-on: ubuntu-latest - needs: [ test_py_os_variations, test_full ] + needs: [ test_py_os_variations, linters_checkers, test_full ] if: always() steps: - name: Successful deploy diff --git a/tests/README.md b/tests/README.md index ad9e6ba..eb01c1b 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,10 +1,10 @@ # The Testing Arena ## The CI -The project has a CI tests suit, that runs on each pull-request (using [tox](https://tox.wiki/)): -1. `--regular` tests for all supported python versions, for each os of windows, ubuntu, macos. +The project has a CI tests suit, that runs on each pull-request: +1. `--regular` tests for all supported python versions, for each os of windows, ubuntu, macos (using [tox](https://tox.wiki/)). 2. Linters: [mypy](https://mypy-lang.org/), [flake8](https://flake8.pycqa.org/en/latest/), [bandit](https://bandit.readthedocs.io/en/latest/), [black](https://github.com/psf/black). - - They run for each os, with the latest supported python. + - They run on the latest supported python, on ubuntu. 3. `pytest --all` in parallel. - Runs on the latest supported python, on ubuntu. - The results are printed as a table in the workflow summery ([for example](https://github.com/tomhea/flip-jump/actions/runs/7170673166/attempts/1#summary-19523946921)). diff --git a/tox.ini b/tox.ini index 7d13fec..f457402 100644 --- a/tox.ini +++ b/tox.ini @@ -12,7 +12,7 @@ python = 3.9: py39 3.10: py310 3.11: py311 - 3.12: py312, mypy, flake8, bandit, black + 3.12: py312 [testenv] setenv = PYTHONPATH = {toxinidir}