Files
Matthew W. Thompson a8bc518b15 Add back some tests
2022-09-13 16:40:02 -05:00

121 lines
3.5 KiB
YAML

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 }}, Latest openff-toolkit ${{ matrix.latest-openff-toolkit }}
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.8", "3.9", "3.10"]
latest-openff-toolkit: [true, false]
steps:
- uses: actions/checkout@v2
- name: Setup Conda Environment
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: devtools/conda-envs/test_env.yaml
extra-specs: |
python=${{ matrix.python-version }}
- name: License OpenEye
shell: bash -l {0}
run: |
echo "${SECRET_OE_LICENSE}" > ${OE_LICENSE}
python -c "from openeye import oechem; assert oechem.OEChemIsLicensed()"
env:
SECRET_OE_LICENSE: ${{ secrets.OE_LICENSE }}
- name: "Install latest openff-toolkit"
if: ${{ matrix.latest-openff-toolkit == true }}
run: |
# Until #225 is complete, we should not assume compatibility with new API
micromamba install "openff-toolkit =0.10.6" -c conda-forge -y
- name: Install Package
run: |
# Can't use 'develop' mode because we remove symlinks after install is complete
python setup.py install
- name: Conda Environment Information
run: |
conda info
conda list
- name: Test Installed Package
run: |
pytest -v -x --log-cli-level $LOGLEVEL --cov=openmmforcefields --durations=20 -nauto --cov-append --cov-report=xml \
openmmforcefields/tests/test_amber_import.py \
# openmmforcefields/tests/test_template_generators.py \
openmmforcefields/tests/test_system_generator.py
env:
LOGLEVEL: "INFO"
KMP_DUPLICATE_LIB_OK: "True"
- name: Test AMBER conversion
run: |
python convert_amber.py --input gaff.yaml --log gaff-tests.csv --verbose
working-directory: ./amber
- name: Test CHARMM conversion
run: |
# TODO: Uncomment these tests when new ParmEd is released
# TODO: Find a way to avoid timing out when running full charmm36.yaml conversion below
# python convert_charmm.py --verbose --in files/waters.yaml && python convert_charmm.py --verbose --in files/charmm36.yaml
# python convert_charmm.py --verbose --in files/waters.yaml
# python convert_charmm.py --verbose
# TODO: Uncomment this when tests are expected to work
# python test_charmm.py --verbose
working-directory: ./charmm
- name: Upload coverage data
uses: actions/upload-artifact@v3
with:
name: coverage-data
path: ".coverage.*"
if-no-files-found: ignore
- name: Download coverage data.
uses: actions/download-artifact@v2
with:
name: coverage-data
- name: Combine coverage & fail if it's <100%.
run: |
python -m coverage combine
python -m coverage html --skip-covered --skip-empty
python -m coverage report --fail-under=100
- name: Upload HTML report if check failed.
uses: actions/upload-artifact@v2
with:
name: html-report
path: htmlcov
if: ${{ failure() }}