Conda latest #1711
Workflow file for this run
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: Conda latest | |
on: | |
release: | |
types: | |
- released | |
- prereleased | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
test: | |
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}, OpenEye=${{ matrix.openeye }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-12] | |
python-version: ["3.10"] | |
openeye: ["true", "false"] | |
env: | |
CI_OS: ${{ matrix.os }} | |
OPENEYE: ${{ matrix.openeye }} | |
PYVER: ${{ matrix.python-version }} | |
OE_LICENSE: ${{ github.workspace }}/oe_license.txt | |
PACKAGE: openff-toolkit | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Vanilla install from conda | |
uses: mamba-org/setup-micromamba@v1 | |
if: ${{ matrix.openeye == 'false' }} | |
with: | |
environment-file: devtools/conda-envs/conda.yaml | |
create-args: >- | |
python=${{ matrix.python-version }} | |
# default - will pull down 2.0 which we don't want! | |
# micromamba-version: latest | |
# pin to latest 1.x release | |
micromamba-version: "1.5.10-0" | |
- name: Install from conda with OpenEye | |
uses: mamba-org/setup-micromamba@v1 | |
if: ${{ matrix.openeye == 'true' }} | |
with: | |
environment-file: devtools/conda-envs/conda_oe.yaml | |
create-args: >- | |
python=${{ matrix.python-version }} | |
# default - will pull down 2.0 which we don't want! | |
# micromamba-version: latest | |
# pin to latest 1.x release | |
micromamba-version: "1.5.10-0" | |
- name: Additional info about the build | |
run: | | |
uname -a | |
df -h | |
ulimit -a | |
- name: Make oe_license.txt file from GH org secret "OE_LICENSE" | |
env: | |
OE_LICENSE_TEXT: ${{ secrets.OE_LICENSE }} | |
run: | | |
echo "${OE_LICENSE_TEXT}" > ${OE_LICENSE} | |
- name: Environment Information | |
run: | | |
conda info | |
conda list | |
- name: Check installed toolkits | |
run: | | |
# Checkout the state of the repo as of the last release (including RCs) | |
export LATEST_TAG=$(git ls-remote --tags https://github.com/openforcefield/openff-toolkit.git | cut -f2 | grep -E "([0-9]+)\.([0-9]+)\.([0-9]+)$" | sort --version-sort | tail -1 | sed 's/refs\/tags\///') | |
git fetch --tags | |
git checkout tags/$LATEST_TAG | |
git log -1 | cat | |
if [[ "$OPENEYE" == true ]]; then | |
python -c "from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE; assert OPENEYE_AVAILABLE, 'OpenEye unavailable'" | |
fi | |
if [[ "$OPENEYE" == false ]]; then | |
if [[ $(conda list | grep openeye-toolkits) ]]; then | |
micromamba remove --force openeye-toolkits --yes | |
fi | |
python -c "from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE; assert not OPENEYE_AVAILABLE, 'OpenEye unexpectedly found'" | |
fi | |
- name: Check that correct OFFTK version was installed | |
run: | | |
# Go up one directory to ensure that we don't just load the OFFTK from the checked-out repo | |
cd ../ | |
export LATEST_TAG=$(git ls-remote --tags https://github.com/openforcefield/openff-toolkit.git | cut -f2 | grep -E "([0-9]+)\.([0-9]+)\.([0-9]+)$" | sort --version-sort | tail -1 | sed 's/refs\/tags\///') | |
export FOUND_VER=$(python -c "import openff.toolkit; print(openff.toolkit.__version__)") | |
echo "Latest tag is" | |
echo $LATEST_TAG | |
echo "Found version is" | |
echo $FOUND_VER | |
if [[ $LATEST_TAG != $FOUND_VER ]]; | |
then echo "Version mismatch" | |
exit 1 | |
fi | |
cd openff-toolkit | |
- name: Test the package | |
run: | | |
python -m pip install utilities/test_plugins | |
pwd | |
ls | |
if [[ "$OPENEYE" == true ]]; then | |
python -c "import openff.toolkit; print(openff.toolkit.__file__)" | |
python -c "import openeye; print(openeye.oechem.OEChemIsLicensed())" | |
fi | |
PYTEST_ARGS=" -r fE --tb=short --runslow openff/toolkit/_tests/conftest.py" | |
PYTEST_ARGS+=" --ignore=openff/toolkit/_tests/test_links.py" | |
pytest $PYTEST_ARGS openff | |
- name: Run example scripts | |
run: | | |
pytest $PYTEST_ARGS openff/toolkit/_tests/test_examples.py | |
- name: Run example notebooks | |
run: | | |
# External examples are temporarily skipped due to parmed incompatibility https://github.com/openforcefield/openff-toolkit/issues/1532 | |
python -m pytest -r fE -v -x --tb=short --nbval-lax --ignore=examples/deprecated --ignore=examples/external examples |