From 1c81fa709f14031940654c399b7d12bfe6ca2953 Mon Sep 17 00:00:00 2001 From: "Matthew W. Thompson" Date: Thu, 15 Dec 2022 11:17:47 -0600 Subject: [PATCH] # This is a combination of 10 commits. # This is the 1st commit message: Add deployment tests # This is the commit message #2: Update # This is the commit message #3: Fix # This is the commit message #4: Trim down differences between environments # This is the commit message #5: Try to isolate crash # This is the commit message #6: Rename environment # This is the commit message #7: Further pare down environments # This is the commit message #8: Bump Python version # This is the commit message #9: Update environments # This is the commit message #10: Double check OpenEye license --- .github/workflows/deployment.yaml | 87 +++++++++++++++++++++ devtools/conda-envs/deployment.yaml | 11 +++ devtools/conda-envs/deployment_openeye.yaml | 12 +++ 3 files changed, 110 insertions(+) create mode 100644 .github/workflows/deployment.yaml create mode 100644 devtools/conda-envs/deployment.yaml create mode 100644 devtools/conda-envs/deployment_openeye.yaml diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml new file mode 100644 index 00000000..5018cea3 --- /dev/null +++ b/.github/workflows/deployment.yaml @@ -0,0 +1,87 @@ +name: Deployment tests + +on: + push: + branches: + - "main" + pull_request: + branches: + - "main" + release: + types: + - released + - prereleased + schedule: + - cron: "0 0 * * *" + workflow_dispatch: + +defaults: + run: + shell: bash -l {0} + +jobs: + test: + + name: ${{ matrix.os }}, 🐍=${{ matrix.python-version }}, 👁️=${{ matrix.openeye }} + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + python-version: ["3.9"] + openeye: ["true", "false"] + + env: + OE_LICENSE: ${{ github.workspace }}/oe_license.txt + + steps: + - uses: actions/checkout@v3 + + - name: Install latest release from conda with OpenEye Toolkits + if: ${{ matrix.openeye == 'true' }} + uses: mamba-org/provision-with-micromamba@main + with: + environment-file: devtools/conda-envs/deployment_openeye.yaml + extra-specs: | + python=${{ matrix.python-version }} + + - name: Install latest release from conda without OpenEye Toolkits + if: ${{ matrix.openeye == 'false' }} + uses: mamba-org/provision-with-micromamba@main + with: + environment-file: devtools/conda-envs/deployment.yaml + extra-specs: | + python=${{ matrix.python-version }} + + - name: License OpenEye Toolkits + if: ${{ matrix.openeye == true }} + env: + OE_LICENSE_TEXT: ${{ secrets.OE_LICENSE }} + run: | + echo "${OE_LICENSE_TEXT}" > ${OE_LICENSE} + python -c "from openeye import oechem; assert oechem.OEChemIsLicensed()" + + - 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: Run tests + run: | + python -c "from openeye import oechem; assert oechem.OEChemIsLicensed()" + python -m pytest -v openff/bespokefit/tests/executor/services/coordinator/test_app.py::test_get_molecule_image + diff --git a/devtools/conda-envs/deployment.yaml b/devtools/conda-envs/deployment.yaml new file mode 100644 index 00000000..db6b9b3c --- /dev/null +++ b/devtools/conda-envs/deployment.yaml @@ -0,0 +1,11 @@ +name: latest-deployment +channels: + - conda-forge +dependencies: + - openff-bespokefit + - ambertools + - pytest + - pytest-cov + - pytest-asyncio + - pytest-celery + - requests-mock diff --git a/devtools/conda-envs/deployment_openeye.yaml b/devtools/conda-envs/deployment_openeye.yaml new file mode 100644 index 00000000..a9545e9d --- /dev/null +++ b/devtools/conda-envs/deployment_openeye.yaml @@ -0,0 +1,12 @@ +name: latest-deployment-openeye +channels: + - conda-forge + - openeye +dependencies: + - openff-bespokefit + - openeye-toolkits + - pytest + - pytest-cov + - pytest-asyncio + - pytest-celery + - requests-mock