Skip to content

Commit

Permalink
merge mypy check job to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fohrloop committed Apr 27, 2024
1 parent 7efaf0a commit e00e23a
Showing 1 changed file with 11 additions and 28 deletions.
39 changes: 11 additions & 28 deletions .github/workflows/build-and-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
python -m pip install ${{ env.TOX_REQUIREMENT }}
tox -e ${{ matrix.python-version }} --skip-build
tox -e show-uncovered-lines
tox -e mypy --skip-build
test-other-platforms:
name: Tests (${{ matrix.python-version }} @${{ matrix.os }})
Expand Down Expand Up @@ -108,6 +109,16 @@ jobs:
tox -e show-uncovered-lines
check-code:
# Reasons this is a separate job
# (1) This runs fast. Different from the other steps, this does not require
# the build step. It gives instant feedback if code has minor problems.
# (2) This runs isort + black + ruff + mypy. For most of there it is enough
# to run it once with one version of python and one OS.
# (3) This runs more comprehensive mypy check as it checks also the tests
# whereas the mypy check in test jobs only runs mypy on the /src
# folder. Note that some mypy check results depend on the used version
# of python and therefore it needs also a separate step (with multiple
# versions of python)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -122,34 +133,6 @@ jobs:
- name: Check code
run: tox -e check

additional-mypy-checks:
# This is an *additional* check for mypy using the oldest and newest
# supported python
runs-on: ubuntu-latest
# Note that it's not possible to build the package using python 3.7
# (build is only tested on the env.PYTHON_VERSION). Therefore this mypy
# check just uses the build from the previous step. And build is required
# since it creates the wakepy._version module.
needs: build-python-distributions
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: wakepy-python-packages
path: ./dist/
- name: Install python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d #v5.1
with:
python-version: ${{ matrix.python-version }}
- name: install tox
run: python${{ matrix.python-version }} -m pip install ${{ env.TOX_REQUIREMENT }}
- name: Check code
run: tox -e mypy --skip-build

test-build-docs:
runs-on: ubuntu-latest
needs: build-python-distributions
Expand Down

0 comments on commit e00e23a

Please sign in to comment.