Skip to content

Commit

Permalink
Add base tests (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyminium authored Oct 21, 2024
1 parent 4347b29 commit 5bcc82b
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/base-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Base tests
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
# weekly tests, Sundays at midnight
- cron: "0 0 * * 0"

concurrency:
# Specific group naming so CI is only cancelled
# within same PR or on merge to main
group: ${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}
cancel-in-progress: true

defaults:
run:
shell: bash -l {0}

env:
OE_LICENSE: ${{ github.workspace }}/oe_license.txt

jobs:
main_tests:
name: CI (${{ matrix.os }}, py-${{ matrix.python-version }}, openeye=${{ matrix.include-openeye }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macOS-13, macOS-latest, ubuntu-latest]
python-version: ["3.10", "3.11", "3.12"]
include-openeye: [false, true]

steps:
- uses: actions/checkout@v4

- name: Build information
run: |
uname -a
df -h
ulimit -a
- name: Install environment
uses: mamba-org/setup-micromamba@v2
with:
environment-file: devtools/conda-envs/base.yaml
create-args: >-
python=${{ matrix.python-version }}
- name: Install package
run: |
python -m pip install . --no-deps
- uses: ./.github/actions/include-openeye
if: matrix.include-openeye == true
with:
openeye-license-text: ${{ secrets.OE_LICENSE }}
openeye-license-file: ${{ env.OE_LICENSE }}


- name: Uninstall OpenEye
if: matrix.include-openeye == false
run: conda remove --force openeye-toolkits --yes || echo "openeye not installed"

- name: Check toolkit installations
shell: bash -l -c "python -u {0}"
run: |
from openff.toolkit.utils.toolkits import OPENEYE_AVAILABLE, RDKIT_AVAILABLE
assert str(OPENEYE_AVAILABLE).lower() == '${{ matrix.include-openeye }}'
assert str(RDKIT_AVAILABLE).lower() == 'true'
- name: Run tests
run: |
python -m pytest -n 4 -v --cov=openff/nagl --cov-config=setup.cfg --cov-append --cov-report=xml --color=yes openff/nagl/
35 changes: 35 additions & 0 deletions devtools/conda-envs/base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: openff-nagl-test
channels:
- conda-forge
- defaults
dependencies:
# Base depends
- python
- pip
- importlib_resources

# UI
- click
- click-option-group
- rich
- tqdm

# chemistry
- openff-toolkit-base >=0.11.1
- openff-units
- pydantic <3
- rdkit
- scipy

# files
- pyyaml

# gcn
- pytorch >=2.0
- pytorch-lightning

# Testing
- pytest
- pytest-cov
- pytest-xdist
- codecov

0 comments on commit 5bcc82b

Please sign in to comment.