CI #1417
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 * * *" | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
test: | |
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}, Toolkit ${{ matrix.toolkit }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: | |
- "3.9" | |
- "3.10" | |
os: | |
- ubuntu-latest | |
- macos-latest | |
toolkit: | |
- true | |
- false | |
env: | |
PYTEST_ARGS: -v --cov=openforcefields --cov-config=setup.cfg --cov-append --cov-report=xml | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Additional info about the build | |
shell: bash | |
run: | | |
uname -a | |
df -h | |
ulimit -a | |
- name: Install dependencies | |
if: ${{ matrix.toolkit == true }} | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: devtools/conda-envs/test_env.yaml | |
create-args: >- | |
python=${{ matrix.python-version }} | |
- name: Install dependencies | |
if: ${{ matrix.toolkit == false }} | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: devtools/conda-envs/test_no_toolkit.yaml | |
create-args: >- | |
python=${{ matrix.python-version }} | |
- name: Install package | |
run: | | |
micromamba remove --force openff-forcefields | |
python -m pip install -e . | |
conda list | |
conda info --all | |
- name: Run water model tests | |
if: ${{ matrix.toolkit == true }} | |
run: | | |
pytest $PYTEST_ARGS openforcefields/tests/test_water_models.py | |
- name: Run unit tests | |
run: | | |
pytest $PYTEST_ARGS openforcefields/tests/test_openforcefields.py | |
- name: Regenerate water models | |
if: ${{ matrix.toolkit == true }} | |
run: | | |
python scripts/get_ion_nb_params_from_ambertools_frcmod.py $AMBERHOME/dat/leap/parm/frcmod.ionslm_126_opc | |
python scripts/get_ion_nb_params_from_ambertools_frcmod.py $AMBERHOME/dat/leap/parm/frcmod.ionslm_126_opc3 | |
python scripts/get_ion_nb_params_from_ambertools_frcmod.py $AMBERHOME/dat/leap/parm/frcmod.ionslm_126_fb3 | |
python scripts/get_ion_nb_params_from_ambertools_frcmod.py $AMBERHOME/dat/leap/parm/frcmod.ionslm_126_fb4 | |
ls scripts/write_*.py | xargs -n 1 -P 3 python | |
- name: Error out if any OFFXML files changed | |
if: ${{ matrix.toolkit == true }} | |
run: | | |
if test "$( git diff openforcefields/offxml/ | wc | awk '{print $1}' )" -gt 0 | |
then | |
exit 1 | |
else | |
echo 'no files differ' | |
fi | |
- name: Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./coverage.xml | |
fail_ci_if_error: false |