CI #2341
This file contains hidden or 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} | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.ref }}" | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-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-latest] | |
python-version: ["3.11", "3.12", "3.13"] | |
amber-conversion: [false] | |
openmm-version: ["8.2.0", "8.3.1"] | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Setup Conda Environment with espaloma | |
if: matrix.python-version != '3.13' | |
uses: mamba-org/setup-micromamba@v2 | |
with: | |
environment-file: devtools/conda-envs/test_env.yaml | |
create-args: >- | |
python=${{ matrix.python-version }} | |
openmm=${{ matrix.openmm-version }} | |
espaloma==0.4.0 | |
- name: Setup Conda Environment | |
if: matrix.python-version == '3.13' | |
uses: mamba-org/setup-micromamba@v2 | |
with: | |
environment-file: devtools/conda-envs/test_env.yaml | |
create-args: >- | |
python=${{ matrix.python-version }} | |
openmm=${{ matrix.openmm-version }} | |
- name: Install Package | |
run: | | |
pip list | |
micromamba list | |
micromamba remove --force openmmforcefields | |
python -m pip install . | |
- name: Conda Environment Information | |
run: | | |
micromamba info | |
micromamba list | |
python -c "from openmmforcefields import __version__, __file__; print(__version__, __file__)" | |
- name: Test Installed Package (With Espaloma) | |
if: matrix.python-version != '3.13' | |
env: | |
COV_ARGS: --cov=openmmforcefields --cov-config=setup.cfg --cov-append --cov-report=xml | |
LOGLEVEL: "INFO" | |
KMP_DUPLICATE_LIB_OK: "True" | |
run: | | |
# https://github.com/openforcefield/openff-units/issues/111 | |
python -c "from openff.units import unit" | |
# https://github.com/openmm/openmmforcefields/issues/399 | |
python -c "import dgl" | |
pytest -n logical --rungaff --runespaloma --log-cli-level $LOGLEVEL $COV_ARGS --durations=20 \ | |
openmmforcefields/tests/ | |
- name: Test Installed Package | |
if: matrix.python-version == '3.13' | |
env: | |
COV_ARGS: --cov=openmmforcefields --cov-config=setup.cfg --cov-append --cov-report=xml | |
LOGLEVEL: "INFO" | |
KMP_DUPLICATE_LIB_OK: "True" | |
run: | | |
# https://github.com/openforcefield/openff-units/issues/111 | |
python -c "from openff.units import unit" | |
pytest -n logical --rungaff --log-cli-level $LOGLEVEL $COV_ARGS --durations=20 \ | |
openmmforcefields/tests/ | |
- name: Test AMBER conversion | |
if: ${{ matrix.amber-conversion }} | |
run: | | |
python convert_amber.py --input gaff.yaml --log gaff-tests.csv --verbose | |
working-directory: ./amber | |
- name: Run docstrings | |
continue-on-error: True | |
run: | | |
pytest --doctest-modules openmmforcefields --ignore=openmmforcefields/tests | |
- name: Upload coverage report to CodeCov | |
uses: codecov/codecov-action@v5 | |
if: ${{ github.repository == 'openmm/openmmforcefields' | |
&& github.event != 'schedule' }} | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage.xml | |
fail_ci_if_error: false # I don't want this to cause CI failures when a developer pushes to a fork |