Simplify environment.yml with minimal dependencies and flexible versi… #80
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [main, feature/*] | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
swig \ | |
cmake \ | |
dssp \ | |
build-essential \ | |
curl \ | |
git \ | |
python3-dev \ | |
gcc \ | |
gfortran \ | |
libblas-dev \ | |
liblapack-dev \ | |
libhdf5-dev \ | |
libnetcdf-dev \ | |
libfftw3-dev \ | |
libopenmm-dev \ | |
libboost-all-dev \ | |
libxml2-dev \ | |
libxslt1-dev \ | |
zlib1g-dev \ | |
libjpeg-dev \ | |
libpng-dev \ | |
libfreetype6-dev \ | |
libatlas-base-dev \ | |
pkg-config | |
- name: Set up conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
python-version: "3.10" | |
channels: conda-forge,defaults,pytorch | |
channel-priority: strict | |
activate-environment: proteinflex-env | |
environment-file: environment.yml | |
auto-activate-base: false | |
auto-update-conda: true | |
use-mamba: true | |
- name: Verify conda environment | |
shell: bash -el {0} | |
run: | | |
conda info | |
conda list | |
python -c "import sys; print('Python version:', sys.version)" | |
- name: Install package | |
shell: bash -el {0} | |
run: | | |
# Verify key dependencies are installed | |
python -c "import numpy; import mdtraj; import prody; import openmm; print('Core dependencies verified')" | |
python -c "import torch; import transformers; print('ML dependencies verified')" | |
- name: Run tests | |
shell: bash -el {0} | |
env: | |
PYTHONPATH: ${{ github.workspace }} | |
OPENMM_CPU_THREADS: 1 | |
PROTEINFLEX_TEST_MODE: 1 | |
PYTHONWARNINGS: ignore::DeprecationWarning | |
TRANSFORMERS_OFFLINE: 1 | |
CUDA_VISIBLE_DEVICES: "" | |
OMP_NUM_THREADS: 1 | |
MKL_NUM_THREADS: 1 | |
run: | | |
# Run tests with coverage | |
pytest tests/ -v --cov=proteinflex --cov-report=xml --import-mode=importlib | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./coverage.xml | |
flags: unittests | |
name: codecov-umbrella | |
fail_ci_if_error: true | |
- name: Check code style | |
shell: bash -el {0} | |
run: | | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=80 --statistics | |
build: | |
runs-on: ubuntu-latest | |
needs: test | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
python-version: "3.10" | |
channels: conda-forge,defaults,pytorch | |
channel-priority: strict | |
activate-environment: proteinflex-env | |
environment-file: environment.yml | |
auto-activate-base: false | |
auto-update-conda: true | |
use-mamba: true | |
- name: Build package | |
shell: bash -el {0} | |
run: | | |
# Build package | |
python -m pip install --upgrade pip build wheel | |
python -m build | |
python setup.py bdist_wheel | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist/ |