-
Notifications
You must be signed in to change notification settings - Fork 23
143 lines (123 loc) · 4.99 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: ci
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
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.10"
- "3.11"
pydantic-version:
- "2"
openeye:
- true
- false
openmm:
- true
- false
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@v4
with:
fetch-depth: 0
- name: Install conda environment
uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.5.10-0'
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: Install and license OpenEye Toolkits
if: ${{ matrix.openeye == true }}
run: |
micromamba install "openeye-toolkits =2024.1.0" -c openeye
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 -c conda-forge
- name: Uninstall OpenMM
if: ${{ matrix.openmm == false && matrix.openeye == true }}
run: |
micromamba remove openmm mdtraj
# Removing mBuild also removes some leaves, need to re-install them
micromamba install rdkit packmol "lammps >=2023.08.02"
- name: Install AmberTools and RDKit
if: ${{ matrix.openeye == false }}
# Unclear why, but around October 2023 this downgrades JAX to broken 0.1.x builds
# and also uninstalls RDKit
run: micromamba install rdkit "ambertools =23" "lammps >=2023.08.02" "jax >=0.3" "jaxlib >=0.3" -c conda-forge
- name: Install Foyer
run: micromamba install "foyer >=0.12.1" -c conda-forge -yq
- name: Run tests
if: always()
run: |
python -m pytest $COV openff/interchange/ -r fExs -n logical --durations=10
- name: Run small molecule regression tests
if: ${{ matrix.openeye == true && matrix.openmm == true }}
run: |
micromamba install "deepdiff =5" rich click -c conda-forge
python -m pip install git+https://github.com/openforcefield/interchange-regression-testing.git@fa07b62824c39af591142b402bd68103f4043f8b
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
if: ${{ matrix.python-version == '3.11' }}
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
python -m mypy -p "openff.interchange" --exclude "openff/interchange/_tests/"
python -m mypy plugins/nonbonded_plugins/
- name: Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: false