Skip to content

Add deployment tests workflow #34

Add deployment tests workflow

Add deployment tests workflow #34

Workflow file for this run

name: Deployment tests
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
release:
types:
- released
- prereleased
schedule:
- cron: "15 0 * * *"
workflow_dispatch:
defaults:
run:
shell: bash -l {0}
jobs:
test:
name: ${{ matrix.os }}, 🐍=${{ matrix.python-version }}, 👁️=${{ matrix.openeye }}, ∫=${{ matrix.integration }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.11"]
openeye: [true, false]
integration: [true]
env:
OE_LICENSE: ${{ github.workspace }}/oe_license.txt
steps:
- uses: actions/checkout@v4
- name: Install latest release from conda with OpenEye Toolkits
if: ${{ matrix.openeye == true }}
uses: mamba-org/setup-micromamba@v1
with:
environment-file: devtools/conda-envs/deployment_openeye.yaml
create-args: >-
python=${{ matrix.python-version }}
- name: Install latest release from conda without OpenEye Toolkits
if: ${{ matrix.openeye == false }}
uses: mamba-org/setup-micromamba@v1
with:
environment-file: devtools/conda-envs/deployment.yaml
create-args: >-
python=${{ matrix.python-version }}
- name: License OpenEye
if: ${{ matrix.openeye == true }}
run: |
echo "${SECRET_OE_LICENSE}" > ${OE_LICENSE}
python -c "from openeye import oechem; assert oechem.OEChemIsLicensed()"
env:
SECRET_OE_LICENSE: ${{ secrets.OE_LICENSE }}
- name: Verify that the latest version was installed
run: |
cd /tmp/
export LATEST_TAG=$(git ls-remote --tags https://github.com/openforcefield/openff-bespokefit.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.bespokefit; print(openff.bespokefit.__version__)")
if [[ $LATEST_TAG != $FOUND_VER ]]; then
echo "Latest tag is"
echo $LATEST_TAG
echo "Found version is"
echo $FOUND_VER
echo "Version mismatch"
exit 1
fi
cd -
- name: Checkout most recent tag
run: |
git fetch --all
git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
- name: Run tests
run: |
python -m pytest --durations=0 openff/bespokefit/_tests
- name: Run Integration Tests
if: ${{ matrix.integration == true }}
shell: bash -l {0}
run: |
openff-bespoke executor run --smiles 'CC' \
--workflow 'default' \
--default-qc-spec xtb gfn2xtb none \
--target-torsion '[C:1]-[C:2]'