[pre-commit.ci] pre-commit autoupdate #188
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" | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
test: | |
name: ${{ matrix.os }}, 🐍=${{ matrix.python-version }}, OpenMM=${{ matrix.openmm }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macOS-latest, ubuntu-latest] | |
openmm: ["true", "false"] | |
python-version: ["3.9", "3.10", "3.11"] | |
pint-version: ["0.21", "0.22"] | |
env: | |
CI_OS: ${{ matrix.os }} | |
PYVER: ${{ matrix.python-version }} | |
PYTEST_ARGS: -v | |
COV: --cov=openff/units --cov-report=xml --cov-config=setup.cfg --cov-append | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install conda environment | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: devtools/conda-envs/test_env.yaml | |
create-args: >- | |
python=${{ matrix.python-version }} | |
pint=${{ matrix.pint-version }} | |
- name: Optionally install OpenMM | |
if: ${{ matrix.openmm == 'true' }} | |
run: | | |
micromamba install "openmm >=7.6" -c conda-forge -yq | |
- name: Verify OpenMM is not installed when not expected | |
if: ${{ matrix.openmm == 'false' }} | |
run: | | |
# If the number of packages matching "*openmm*" is greater than zero | |
if [[ $(conda list | grep openmm | wc -l) -gt 0 ]]; then | |
conda list; | |
exit 1; | |
fi | |
- name: Additional info about the build | |
shell: bash | |
run: | | |
uname -a | |
df -h | |
ulimit -a | |
- name: Environment Information | |
run: | | |
conda info | |
conda list | |
- name: Install package | |
run: | | |
python setup.py develop --no-deps | |
- name: Run mypy | |
# https://github.com/hgrecco/pint/issues/1767 | |
if: ${{ matrix.python-version == 'false' }} | |
run: | | |
mypy -p "openff.units" | |
- name: Run unit tests with OpenMM | |
if: ${{ matrix.openmm == 'true' }} | |
run: | | |
pytest $PYTEST_ARGS $COV openff/units/tests/ | |
- name: Run unit tests without OpenMM | |
if: ${{ matrix.openmm == 'false' }} | |
run: | | |
pytest $PYTEST_ARGS $COV openff/units/tests/ \ | |
--ignore=openff/units/tests/test_openmm.py | |
- name: Run docexamples | |
if: ${{ matrix.openmm == 'true' }} | |
run: | | |
pytest --doctest-modules $PYTEST_ARGS $COV openff --ignore=openff/units/tests | |
- name: Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./coverage.xml | |
fail_ci_if_error: false |