diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml new file mode 100644 index 00000000..74529b1b --- /dev/null +++ b/.github/workflows/deployment.yaml @@ -0,0 +1,77 @@ +name: Deployment tests + +on: + schedule: + - cron: "10 */12 * * *" + 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: + fail-fast: false + 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@v2 + 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@v2 + 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: Checkout most recent tag + id: vars + run: | + echo "PULL_REQUEST_HEAD=$(git log -1 --format=%H)" >> $GITHUB_OUTPUT + + 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 }} + run: | + openff-bespoke executor run --smiles 'CC' \ + --workflow 'default' \ + --default-qc-spec xtb gfn2xtb none \ + --target-torsion '[C:1]-[C:2]' + + - name: Go back to pull request HEAD + # setup-micromamba needs the environment file to exist, which it might not on the most recent tag + run: git checkout ${{ steps.vars.outputs.PULL_REQUEST_HEAD }} diff --git a/devtools/conda-envs/deployment.yaml b/devtools/conda-envs/deployment.yaml new file mode 100644 index 00000000..10ef4851 --- /dev/null +++ b/devtools/conda-envs/deployment.yaml @@ -0,0 +1,12 @@ +name: latest-deployment +channels: + - conda-forge +dependencies: + - openff-bespokefit + - ambertools + - xtb-python + - 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..a282e73b --- /dev/null +++ b/devtools/conda-envs/deployment_openeye.yaml @@ -0,0 +1,13 @@ +name: latest-deployment-openeye +channels: + - conda-forge + - openeye +dependencies: + - openff-bespokefit + - openeye-toolkits + - xtb-python + - pytest + - pytest-cov + - pytest-asyncio + - pytest-celery + - requests-mock diff --git a/devtools/conda-envs/docs-env.yaml b/devtools/conda-envs/docs-env.yaml index c51b37e9..49e43239 100644 --- a/devtools/conda-envs/docs-env.yaml +++ b/devtools/conda-envs/docs-env.yaml @@ -18,8 +18,7 @@ dependencies: - click-option-group - rdkit =2024.03.5 - openff-utilities - - openff-toolkit-base =0.15 - - openff-interchange # only needed because openff-toolkit-base + - openff-toolkit >=0.15 - openff-forcefields >=2024.04.0 - openff-qcsubmit >=0.50 - openmm >=7.6.0 diff --git a/devtools/conda-envs/no_openeye.yaml b/devtools/conda-envs/no_openeye.yaml index ab97952d..7369e46f 100644 --- a/devtools/conda-envs/no_openeye.yaml +++ b/devtools/conda-envs/no_openeye.yaml @@ -22,7 +22,6 @@ dependencies: - ambertools >=22 - openff-utilities - openff-toolkit >=0.15 - - openff-interchange # only needed because openff-toolkit-base - openff-forcefields >=2024.04.0 - openff-qcsubmit >=0.50 - openmm >=7.6.0 diff --git a/devtools/conda-envs/test-env.yaml b/devtools/conda-envs/test-env.yaml index 53d9b74a..4ade6fd4 100644 --- a/devtools/conda-envs/test-env.yaml +++ b/devtools/conda-envs/test-env.yaml @@ -22,7 +22,6 @@ dependencies: - rdkit =2024.03.5 - openff-utilities - openff-toolkit >=0.15 - - openff-interchange # only needed because openff-toolkit-base - openff-forcefields >=2024.04.0 - openff-units - openff-qcsubmit >=0.50 diff --git a/docs/releasehistory.md b/docs/releasehistory.md index c6783249..e5090772 100644 --- a/docs/releasehistory.md +++ b/docs/releasehistory.md @@ -8,7 +8,12 @@ Releases follow the ``major.minor.micro`` scheme recommended by * `micro` increments represent bugfix releases or improvements in documentation -## Current Development +## Current development + +### Tests updated +* [#207] - Adds deployment tests [@mattwthompson @jthorton @Yoshanuikabundi] + +## 0.4.1 / 07-11-2024 ### Bug fixes * [#370] - Check that the `extras` field on QCArchive records is not `None` before accessing it to avoid crashes [@ntBre]