Virtual site overhaul #2759
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
test: | |
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}, OpenMM ${{ matrix.openmm }}, Pydantic ${{ matrix.pydantic-version }}, OpenEye ${{ matrix.openeye }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- macOS-latest | |
- ubuntu-latest | |
python-version: | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
pydantic-version: | |
- "1" | |
- "2" | |
openeye: | |
- true | |
- false | |
openmm: | |
- true | |
- false | |
exclude: | |
- openeye: false | |
python-version: "3.11" | |
- pydantic-version: "1" | |
python-version: "3.9" | |
- pydantic-version: "1" | |
python-version: "3.10" | |
env: | |
OE_LICENSE: ${{ github.workspace }}/oe_license.txt | |
COV: --cov=openff/interchange --cov-report=xml --cov-config=setup.cfg --cov-append | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install conda environment | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: devtools/conda-envs/test_env.yaml | |
create-args: >- | |
python=${{ matrix.python-version }} | |
pydantic=${{ matrix.pydantic-version }} | |
- name: Install package | |
run: | | |
# These packages are brought in by conda (via the toolkit) and must be removed manually | |
# since pip doesn't know about the -base split and does not uninstall the -base package | |
micromamba remove --force openff-interchange openff-interchange-base | |
python -m pip install . plugins/ | |
- name: Environment Information | |
run: | | |
conda info | |
conda list | |
- name: Install and license OpenEye Toolkits | |
if: ${{ matrix.openeye == true }} | |
run: | | |
micromamba install openeye-toolkits -c openeye -yq | |
echo "${SECRET_OE_LICENSE}" > ${OE_LICENSE} | |
python -c "from openeye import oechem; assert oechem.OEChemIsLicensed()" | |
env: | |
SECRET_OE_LICENSE: ${{ secrets.OE_LICENSE }} | |
- name: Install OpenMM | |
if: ${{ matrix.openmm == true }} | |
run: | | |
micromamba install openmm "smirnoff-plugins =2023" -yq | |
pip install git+https://github.com/mattwthompson/de-forcefields.git@periodic-nonperiodic-methods | |
# Might not need this after re-packaging | |
- name: Uninstall OpenMM | |
if: ${{ matrix.openmm == false }} | |
run: | | |
micromamba remove openmm -yq | |
- name: Install AmberTools | |
if: ${{ matrix.openeye == false }} | |
run: | | |
micromamba install ambertools -c conda-forge -yq | |
- name: Install Foyer | |
if: ${{ matrix.pydantic-version == 1 }} | |
run: | | |
micromamba install foyer -c conda-forge -yq | |
- name: Run tests | |
if: always() | |
run: | | |
python -m pytest -r fE -nauto --durations=10 $COV openff/interchange/ -m "slow or not slow" --ignore=openff/interchange/_tests/energy_tests/test_energies.py | |
- name: Run small molecule regression tests | |
if: ${{ matrix.python-version == 3.9 && matrix.openeye == true && matrix.openmm == true }} | |
run: | | |
micromamba install deepdiff rich click -c conda-forge -yq | |
python -m pip install git+https://github.com/openforcefield/interchange-regression-testing.git | |
create_openmm_systems \ | |
--input "regression_tests/small-molecule/input-topologies.json" \ | |
--output "regression_tests/small-molecule/" \ | |
--using-interchange \ | |
--force-field "openff-2.0.0.offxml" \ | |
--n-procs 2 | |
# Don't trust the interchange version here, for some reason, just put it in a new directory | |
mkdir regression_tests/small-molecule/omm-systems-interchange-latest/ | |
mv regression_tests/small-molecule/omm-systems-interchange-*/*xml regression_tests/small-molecule/omm-systems-interchange-latest/ | |
compare_openmm_systems \ | |
--input-dir-a "regression_tests/small-molecule/omm-systems-toolkit-0.10.6" \ | |
--input-dir-b "regression_tests/small-molecule/omm-systems-interchange-latest" \ | |
--output "regression_tests/differences.json" \ | |
--settings "regression_tests/default-comparison-settings.json" \ | |
--expected-changes "regression_tests/toolkit-to-interchange.json" \ | |
--n-procs 2 | |
python devtools/scripts/molecule-regressions.py | |
- name: Run mypy | |
continue-on-error: true | |
run: | | |
# As of 01/23, JAX with mypy is too slow to use without a pre-built cache | |
# https://github.com/openforcefield/openff-interchange/pull/578#issuecomment-1369979875 | |
micromamba remove jax -yq | |
mypy --show-error-codes --namespace-packages -p "openff.interchange" | |
mypy --show-error-codes plugins/nonbonded_plugins/ | |
- name: Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./coverage.xml | |
fail_ci_if_error: false |