5858
5959 - name : Install conda dependencies
6060 run : |
61- micromamba install -n a2 -c conda-forge enumlib packmol bader openbabel openff-toolkit==0.16.2 openff-interchange==0.3.22 --yes
61+ micromamba install -n a2 -c conda-forge enumlib packmol bader --yes
6262
6363 - name : Install dependencies
6464 run : |
8787 # However this `splitting-algorithm` means that tests cannot depend sensitively on the order they're executed in.
8888 run : |
8989 micromamba activate a2
90- pytest --splits 3 --group ${{ matrix.split }} --durations-path tests/.pytest-split-durations --splitting-algorithm least_duration --ignore=tests/ase --cov=atomate2 --cov-report=xml
90+ pytest --splits 3 --group ${{ matrix.split }} --durations-path tests/.pytest-split-durations --splitting-algorithm least_duration --ignore=tests/ase --ignore=tests/openff_md --ignore=tests/openmm_md --cov=atomate2 --cov-report=xml
91+
9192
9293 - uses : codecov/codecov-action@v1
9394 if : matrix.python-version == '3.10' && github.repository == 'materialsproject/atomate2'
9697 name : coverage${{ matrix.split }}
9798 file : ./coverage.xml
9899
100+ test-openff :
101+ # prevent this action from running on forks
102+ if : github.repository == 'materialsproject/atomate2'
103+
104+ services :
105+ local_mongodb :
106+ image : mongo:4.0
107+ ports :
108+ - 27017:27017
109+
110+ runs-on : ubuntu-latest
111+ defaults :
112+ run :
113+ shell : bash -l {0} # enables conda/mamba env activation by reading bash profile
114+ strategy :
115+ matrix :
116+ python-version : ["3.10","3.11","3.12"]
117+
118+ steps :
119+ - name : Check out repo
120+ uses : actions/checkout@v4
121+
122+ - name : Set up micromamba
123+ uses : mamba-org/setup-micromamba@main
124+
125+ - name : Create mamba environment
126+ run : |
127+ micromamba create -n a2 python=${{ matrix.python-version }} --yes
128+
129+ - name : Install uv
130+ run : micromamba run -n a2 pip install uv
131+
132+ - name : Install conda dependencies
133+ run : |
134+ micromamba install -n a2 -c conda-forge enumlib packmol bader openbabel openff-toolkit==0.16.2 openff-interchange==0.3.22 --yes
135+
136+ - name : Install dependencies
137+ run : |
138+ micromamba activate a2
139+ python -m pip install --upgrade pip
140+ uv pip install .[strict-openff,tests]
141+
142+ - name : Install pymatgen from master if triggered by pymatgen repo dispatch
143+ if : github.event_name == 'repository_dispatch' && github.event.action == 'pymatgen-ci-trigger'
144+ run : |
145+ micromamba activate a2
146+ uv pip install --upgrade 'git+https://github.com/materialsproject/pymatgen@${{ github.event.client_payload.pymatgen_ref }}'
147+
148+ - name : Test split ${{ matrix.split }}
149+ env :
150+ MP_API_KEY : ${{ secrets.MP_API_KEY }}
151+
152+ run : |
153+ micromamba activate a2
154+ pytest tests/{openff_md,openmm_md}
155+
99156 test-notebooks-and-ase :
100157 # prevent this action from running on forks
101158 if : github.repository == 'materialsproject/atomate2'
@@ -148,9 +205,11 @@ jobs:
148205 run : uv pip install --upgrade 'git+https://github.com/materialsproject/pymatgen@${{ github.event.client_payload.pymatgen_ref }}'
149206
150207 - name : Test Notebooks
208+ env :
209+ MP_API_KEY : ${{ secrets.MP_API_KEY }}
151210 run : |
152211 micromamba activate a2
153- pytest --nbmake ./tutorials --ignore=./tutorials/openmm_tutorial.ipynb
212+ pytest --nbmake ./tutorials --ignore=./tutorials/openmm_tutorial.ipynb --ignore=./tutorials/force_fields
154213
155214 - name : Test ASE
156215 env :
@@ -165,6 +224,81 @@ jobs:
165224 token : ${{ secrets.CODECOV_TOKEN }}
166225 file : ./coverage.xml
167226
227+ test-force-field-notebook :
228+ # prevent this action from running on forks
229+ if : github.repository == 'materialsproject/atomate2'
230+
231+ services :
232+ local_mongodb :
233+ image : mongo:4.0
234+ ports :
235+ - 27017:27017
236+
237+ runs-on : ubuntu-latest
238+ defaults :
239+ run :
240+ shell : bash -l {0} # enables conda/mamba env activation by reading bash profile
241+ strategy :
242+ matrix :
243+ python-version : ["3.10", "3.11", "3.12"]
244+
245+ steps :
246+ - name : Check out repo
247+ uses : actions/checkout@v4
248+
249+ - name : Set up micromamba
250+ uses : mamba-org/setup-micromamba@main
251+
252+ - name : Create mamba environment
253+ run : |
254+ micromamba create -n a2 python=${{ matrix.python-version }} --yes
255+
256+ - name : Install uv
257+ run : micromamba run -n a2 pip install uv
258+
259+ - name : Install conda dependencies
260+ run : |
261+ micromamba install -n a2 -c conda-forge enumlib packmol bader openbabel openff-toolkit==0.16.2 openff-interchange==0.3.22 --yes
262+
263+ - name : Install dependencies
264+ run : |
265+ micromamba activate a2
266+ python -m pip install --upgrade pip
267+ mkdir -p ~/.abinit/pseudos
268+ cp -r tests/test_data/abinit/pseudos/ONCVPSP-PBE-SR-PDv0.4 ~/.abinit/pseudos
269+ uv pip install .[strict,strict-forcefields,tests,abinit]
270+ uv pip install torch-runstats
271+ uv pip install --no-deps nequip==0.5.6
272+
273+ - name : Install pymatgen from master if triggered by pymatgen repo dispatch
274+ if : github.event_name == 'repository_dispatch' && github.event.action == 'pymatgen-ci-trigger'
275+ run : |
276+ micromamba activate a2
277+ uv pip install --upgrade 'git+https://github.com/materialsproject/pymatgen@${{ github.event.client_payload.pymatgen_ref }}'
278+
279+ - name : Forcefield tutorial
280+ env :
281+ MP_API_KEY : ${{ secrets.MP_API_KEY }}
282+
283+ # regenerate durations file with `pytest --store-durations --durations-path tests/.pytest-split-durations`
284+ # Note the use of `--splitting-algorithm least_duration`.
285+ # This helps prevent a test split having no tests to run, and then the GH action failing, see:
286+ # https://github.com/jerry-git/pytest-split/issues/95
287+ # However this `splitting-algorithm` means that tests cannot depend sensitively on the order they're executed in.
288+ run : |
289+ micromamba activate a2
290+ pytest --nbmake ./tutorials/force_fields
291+
292+
293+ - uses : codecov/codecov-action@v1
294+ if : matrix.python-version == '3.10' && github.repository == 'materialsproject/atomate2'
295+ with :
296+ token : ${{ secrets.CODECOV_TOKEN }}
297+ name : coverage
298+ file : ./coverage.xml
299+
300+
301+
168302 docs :
169303 runs-on : ubuntu-latest
170304
@@ -186,7 +320,7 @@ jobs:
186320 run : sphinx-build docs docs_build
187321
188322 automerge :
189- needs : [lint, test-non-ase, test-notebooks-and-ase, docs]
323+ needs : [lint, test-non-ase, test-notebooks-and-ase, test-force-field-notebook, docs]
190324 runs-on : ubuntu-latest
191325
192326 permissions :
0 commit comments