mirror of
https://github.com/OpenFreeEnergy/openfe.git
synced 2026-06-04 14:14:22 +08:00
* add openeye w/ python 3.13 test to CI * only run openeye on unbuntu w/ python 3.13 * add explicit openeye no
163 lines
5.2 KiB
YAML
163 lines
5.2 KiB
YAML
name: "CI"
|
|
on:
|
|
pull_request:
|
|
# Skip CI if changed files only affect the following folders
|
|
# - docs: documentation changes don't need code validation
|
|
# See here for more details: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-excluding-paths
|
|
paths-ignore:
|
|
- "docs/*"
|
|
- "news/*"
|
|
- ".readthedocs.yaml"
|
|
- ".github/workflows/cpu-long-tests.yaml"
|
|
- ".github/workflows/gpu-integration-tests.yaml"
|
|
push:
|
|
branches:
|
|
- main
|
|
schedule:
|
|
- cron: "0 4 * * *"
|
|
workflow_dispatch:
|
|
release:
|
|
types:
|
|
- published
|
|
|
|
concurrency:
|
|
group: "${{ github.workflow }}-${{ github.ref }}"
|
|
cancel-in-progress: true
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash -leo pipefail {0}
|
|
|
|
jobs:
|
|
tests:
|
|
runs-on: ${{ matrix.os }}
|
|
name: "💻-${{matrix.os }} 🐍-${{ matrix.python-version }} oechem: ${{ matrix.openeye }}"
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: ["ubuntu-latest", "macos-latest"]
|
|
openeye: ["no"]
|
|
python-version:
|
|
- "3.11"
|
|
- "3.12"
|
|
- "3.13"
|
|
include:
|
|
- os: "ubuntu-latest"
|
|
python-version: "3.13"
|
|
openeye: "yes"
|
|
|
|
env:
|
|
OE_LICENSE: ${{ github.workspace }}/oe_license.txt
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Get current date
|
|
id: date
|
|
run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
|
|
|
|
- name: "Setup Micromamba"
|
|
if: ${{ matrix.python-version != '3.13' }}
|
|
uses: mamba-org/setup-micromamba@v2
|
|
with:
|
|
environment-file: environment.yml
|
|
environment-name: openfe_env
|
|
cache-environment: true
|
|
cache-downloads: true
|
|
cache-environment-key: environment-${{ steps.date.outputs.date }}
|
|
cache-downloads-key: downloads-${{ steps.date.outputs.date }}
|
|
create-args: >-
|
|
espaloma=0.4.0
|
|
python=${{ matrix.python-version }}
|
|
pydantic=${{ matrix.pydantic-version }}
|
|
init-shell: bash
|
|
|
|
- name: "Setup Micromamba"
|
|
# Can't install espaloma with python 3.13
|
|
if: ${{ matrix.python-version == '3.13' }}
|
|
uses: mamba-org/setup-micromamba@v2
|
|
with:
|
|
environment-file: environment.yml
|
|
environment-name: openfe_env
|
|
cache-environment: true
|
|
cache-downloads: true
|
|
cache-environment-key: environment-${{ steps.date.outputs.date }}
|
|
cache-downloads-key: downloads-${{ steps.date.outputs.date }}
|
|
create-args: >-
|
|
python=${{ matrix.python-version }}
|
|
pydantic=${{ matrix.pydantic-version }}
|
|
init-shell: bash
|
|
|
|
- name: "Install OpenEye"
|
|
if: ${{ !github.event.pull_request.head.repo.fork
|
|
&& matrix.openeye == 'yes' }}
|
|
env:
|
|
OE_LICENSE_TEXT: ${{ secrets.OE_LICENSE }}
|
|
run: |
|
|
echo "${OE_LICENSE_TEXT}" > ${OE_LICENSE}
|
|
micromamba install -c openeye openeye-toolkits
|
|
python -c "import openeye; assert openeye.oechem.OEChemIsLicensed(), 'oechem license check failed!'"
|
|
|
|
- name: "Install"
|
|
run: python -m pip install --no-deps -e .
|
|
|
|
- name: "Environment Information"
|
|
run: |
|
|
micromamba info
|
|
micromamba list
|
|
pip list
|
|
|
|
- name: "Test imports"
|
|
run: |
|
|
# if we add more to this, consider changing to for + env vars
|
|
python -Ic "import openfe; print(openfe.__version__)"
|
|
|
|
- name: Cache Pooch data
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
# linux cache location
|
|
~/.cache/openfe
|
|
# osx cache location
|
|
~/Library/Caches/openfe
|
|
# When files are added or changed in a pooch registry
|
|
# bump this key to create a new cache, for example if
|
|
# the key is pooch-${{ matrix.os }}-1 change it to pooch-${{ matrix.os }}-2
|
|
key: pooch-${{ matrix.os }}-1
|
|
|
|
- name: "Run tests"
|
|
env:
|
|
# Set the OFE_SLOW_TESTS to True if running a Cron job
|
|
OFE_SLOW_TESTS: ${{ fromJSON('{"false":"false","true":"true"}')[github.event_name != 'pull_request'] }}
|
|
DUECREDIT_ENABLE: 'yes'
|
|
run: |
|
|
pytest -n auto -v --cov=openfe --cov=openfecli --cov-report=xml --durations=10
|
|
|
|
- name: codecov-pr
|
|
if: ${{ github.repository == 'OpenFreeEnergy/openfe'
|
|
&& github.event_name == 'pull_request' }}
|
|
uses: codecov/codecov-action@v4
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
file: coverage.xml
|
|
fail_ci_if_error: False
|
|
verbose: True
|
|
flags: fast-tests
|
|
|
|
- name: codecov-merge
|
|
# we only want to upload a slow report if
|
|
# 1) it isn't a schedule run
|
|
# 2) it wasn't from a PR (we don't run slow tests on PRs)
|
|
if: ${{ github.repository == 'OpenFreeEnergy/openfe'
|
|
&& github.event_name != 'schedule'
|
|
&& github.event_name != 'pull_request' }}
|
|
uses: codecov/codecov-action@v4
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
file: coverage.xml
|
|
fail_ci_if_error: False
|
|
verbose: True
|
|
flags: slow-tests
|