Skip to content

Run type-checking

Run type-checking #189

Workflow file for this run

name: ci
on:
push:
branches:
- "main"
- "yammbs-models"
pull_request:
branches:
- "main"
- "yammbs-models"
workflow_dispatch:
defaults:
run:
shell: bash -l {0}
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macOS-12
- macOS-latest
- ubuntu-latest
python-version:
- "3.10"
- "3.11"
- "3.12"
exclude:
- os: macOS-12
python-version: "3.12"
- os: mac-latest
python-version: "3.12"
env:
OE_LICENSE: ${{ github.workspace }}/oe_license.txt
steps:
- uses: actions/checkout@v4
- name: Set up conda environment
uses: mamba-org/setup-micromamba@v2
with:
environment-file: devtools/conda-envs/dev.yaml
create-args: >-
python=${{ matrix.python-version }}
- name: Install PASCAL Compiler (MacOS)
if: startsWith(matrix.os, 'mac')
run: brew install fpc
- name: Install PASCAL Compiler (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get install fp-compiler
- name: Install checkmol
run: |
curl https://homepage.univie.ac.at/norbert.haider/download/chemistry/checkmol/checkmol.pas > checkmol.pas
fpc checkmol.pas -S2
echo $(pwd) >> $GITHUB_PATH
- name: Install package
run: python -m pip install -e .
- name: Install and license OpenEye Toolkits
run: |
echo "${SECRET_OE_LICENSE}" > ${OE_LICENSE}
python -c "from openeye import oechem; assert oechem.OEChemIsLicensed()"
env:
SECRET_OE_LICENSE: ${{ secrets.OE_LICENSE }}
- name: Run tests
run: |
pytest -r fEx -n logical --durations=10 \
--cov=yammbs/ --cov-report=xml --cov-config=setup.cfg \
yammbs/
- name: Run mypy
# RDKit packages have bad stubs on Linux for some reason
if: ${{ matrix.python-version == '3.12' && matrix.os == 'macos-latest' }}
run: pip install -r typing-requirements.txt && python -m mypy -p "yammbs" --exclude "yammbs/_tests"
- name: CodeCov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests