Skip to content

Update deployment test environments #1555

Update deployment test environments

Update deployment test environments #1555

Workflow file for this run

name: Conda latest
on:
push:
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:
OPENEYE: ${{ matrix.openeye }}
OE_LICENSE: ${{ github.workspace }}/oe_license.txt
PYTEST_ARGS: -r fE --tb=short -n logical --durations=20
steps:
- uses: actions/checkout@v4
- name: Vanilla install from conda
uses: mamba-org/setup-micromamba@v1
with:
environment-name: latest-deployment
create-args: >-
python=${{ matrix.python-version }}
openff-toolkit-examples
smirnoff-plugins=2024
pytest-xdist
pytest-rerunfailures
- name: Install OpenEye Toolkits
if: ${{ matrix.openeye == 'true' }}
run: micromamba install openeye-toolkits -c openeye
- name: Make oe_license.txt file from GH org secret "OE_LICENSE"
if: ${{ matrix.openeye == 'true' }}
env:
OE_LICENSE_TEXT: ${{ secrets.OE_LICENSE }}
run: |
echo "${OE_LICENSE_TEXT}" > ${OE_LICENSE}
- name: Environment Information
run: micromamba info && micromamba list
- name: Check installed toolkits
run: |
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\///')
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: |
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
- name: Test the package
run: |
# Act like we're testing with this patch deployed ...
python -m pip install . utilities/test_plugins/
if [[ "$OPENEYE" == true ]]; then
python -c "import openff.toolkit; print(openff.toolkit.__file__)"
python -c "import openeye; print(openeye.oechem.OEChemIsLicensed())"
fi
PYTEST_ARGS+=" --ignore-glob='*_links.py'"
PYTEST_ARGS+=" --ignore-glob='*_examples.py'"
PYTEST_ARGS+=" --ignore-glob='*_nagl.py'"
env
python -m pytest $PYTEST_ARGS \
--pyargs "openff.toolkit" \
-m "slow or not slow" -x