Skip to content

tests

tests #1788

Workflow file for this run

name: tests
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
schedule:
- cron: "0 0 * * *"
defaults:
run:
shell: bash -l {0}
jobs:
test:
name: 💻 ${{ matrix.os }}, 🐍 ${{ matrix.python-version }}, 👀 ${{ matrix.openeye }}, pymbar ${{ matrix.pymbar-version }}, Pydantic ${{ matrix.pydantic-version }}, OpenMM ${{ matrix.openmm-version }}
runs-on: ${{ matrix.os }}
env:
OE_LICENSE: ${{ github.workspace }}/oe_license.txt
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-12
python-version:
- "3.10"
- "3.11"
- "3.12"
pymbar-version:
- "3.1"
pydantic-version:
- "2"
openmm-version:
- "7"
- "8"
openeye:
- true
- false
exclude:
- python-version: "3.11"
openmm-version: "7"
- python-version: "3.12"
openmm-version: "7"
- os: "macos-12"
openmm-version: "7"
- python-version: "3.12"
openeye: true
- python-version: "3.11"
pymbar-version: "3.1"
- python-version: "3.12"
pymbar-version: "3.1"
steps:
- uses: actions/checkout@v4
- name: Setup Conda Environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: devtools/conda-envs/test_env.yaml
create-args: >-
python=${{ matrix.python-version }}
pymbar=${{ matrix.pymbar-version }}
pydantic=${{ matrix.pydantic-version }}
openmm=${{ matrix.openmm-version }}
- name: Install OpenEye
if: matrix.openeye
run: |
echo "${SECRET_OE_LICENSE}" > ${OE_LICENSE}
micromamba install -c openeye "openeye-toolkits =2024.1.0"
python -c "from openeye import oechem; assert oechem.OEChemIsLicensed()"
env:
SECRET_OE_LICENSE: ${{ secrets.OE_LICENSE }}
- name: Install PASCAL Compiler (MacOS)
if: startsWith(matrix.os, 'macOS')
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 and test plugins
run: python -m pip install . utilities/test_plugins/
- name: Run tests
run: python -m pytest -v --cov=openff openff/evaluator/_tests/ --cov-report=xml --color=yes
- name: Run (non-GPU) tutorials
if: ${{ matrix.pymbar-version == 3.1 }}
run: |
# ForceBalance requires pymbar 3, so don't run these tests if we are using pymbar 4,
# even though we're not running the fitting tutorial
# https://github.com/conda-forge/forcebalance-feedstock/blob/9793b0205489f8ec7826d301a3c82cfb96997c57/recipe/meta.yaml#L29
micromamba install "forcebalance >=1.9.5" -c conda-forge -yq
python -m pytest --nbval-lax --dist loadscope -nauto -p no:randomly \
docs/tutorials/tutorial01.ipynb \
docs/tutorials/tutorial03.ipynb
- name: Code coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}