Skip to content

Commit

Permalink
Run mypy in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jbarnoud committed Sep 14, 2023
1 parent d0df6fa commit 2972b2e
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
# This is necessary for the conda action. It replaces `conda init` as
# the shell does not load ,profile or .bashrc.
shell: bash -el {0}
steps:
- uses: actions/checkout@v3
Expand All @@ -24,6 +26,43 @@ jobs:
run: python -m pytest --cov narupa python-libraries -n auto -m 'not serial'
- name: Serial tests
run: python -m pytest --cov narupa python-libraries -n auto -m 'serial'
mypy:
name: Type analysis for python
runs-on: ubuntu-latest
defaults:
run:
# This is necessary for the conda action. It replaces `conda init` as
# the shell does not load ,profile or .bashrc.
shell: bash -el {0}
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
miniforge-version: latest
- name: Install narupa dependancies
run: conda install mpi4py openmm
- name: Install tests dependancies
run: python -m pip install -r python-libraries/requirements.test
- name: Compile
run: ./compile.sh --no-dotnet
- name: mypy
run: |
# Mypy accepts paths, modules or packages as inputs. However, only
# packages work reasonably well with packages. So we need to generate
# a list of the packages we want to test.
packages=$(find python-libraries -name __init__.py \
| sed 's/__init__.py//g' \
| awk '{split($0, a, /src/); print(a[2])}' \
| sed 's#/#.#g' \
| cut -c 2- \
| sed 's/\.$//g' \
| grep -v '^$' \
| grep -v protocol \
| sed 's/^/-p /g' \
| grep -v '\..*\.' \
| tr '\n' ' ')
mypy --ignore-missing-imports --namespace-packages $packages
csharp-tests:
name: C# unit and integration tests
runs-on: ubuntu-latest
Expand Down

0 comments on commit 2972b2e

Please sign in to comment.