Skip to content

Commit

Permalink
linters are separated into a new job in tests.yml
Browse files Browse the repository at this point in the history
- They now run only on ubuntu-latest.
  • Loading branch information
tomhea committed Dec 12, 2023
1 parent 9480b0b commit a75b02b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Note: add all job names to the deploy-status.needs.

name: Tests

on:
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -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)).
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit a75b02b

Please sign in to comment.