Skip to content

Commit 242ceaf

Browse files
Same as #30 but the PR is opened from upstream repository instead of fork (#32)
See PR #30 for more details. This PR is open to check if ci runs on the repository. --------- Co-authored-by: Franz Király <fkiraly@gcos.ai>
1 parent b5ef8df commit 242ceaf

43 files changed

Lines changed: 5835 additions & 11942 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
# MAWS CI/CD Workflow
2+
# Runs tests on Linux with AmberTools and OpenMM across Python 3.10-3.13
3+
# Includes optional GPU testing when self-hosted runners with GPU are available
4+
5+
name: CI
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
pull_request:
12+
branches:
13+
- main
14+
workflow_dispatch: # Allow manual trigger
15+
16+
jobs:
17+
# ============================================================================
18+
# Full integration tests with AmberTools (CPU)
19+
# ============================================================================
20+
test:
21+
name: Test Python ${{ matrix.python-version }}
22+
runs-on: ubuntu-latest
23+
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
python-version: ["3.10", "3.11", "3.12", "3.13"]
28+
29+
defaults:
30+
run:
31+
shell: bash -el {0} # Required for conda activate
32+
33+
steps:
34+
- name: Checkout repository
35+
uses: actions/checkout@v4
36+
37+
- name: Setup Miniconda
38+
uses: conda-incubator/setup-miniconda@v3
39+
with:
40+
miniforge-version: latest
41+
python-version: ${{ matrix.python-version }}
42+
channels: conda-forge,bioconda,defaults
43+
channel-priority: strict
44+
activate-environment: maws
45+
auto-activate-base: false
46+
47+
- name: Install dependencies via conda
48+
run: |
49+
conda activate maws
50+
conda install -y openmm ambertools mpmath numba pandas numpy
51+
52+
- name: Install package and dev dependencies
53+
run: |
54+
conda activate maws
55+
pip install -e ".[dev]"
56+
57+
- name: Verify AmberTools installation
58+
run: |
59+
conda activate maws
60+
which tleap
61+
tleap -h || echo "tleap help displayed"
62+
63+
- name: Run tests
64+
run: |
65+
conda activate maws
66+
pytest tests/ -v --tb=short
67+
68+
- name: Run tests with coverage
69+
if: matrix.python-version == '3.10'
70+
run: |
71+
conda activate maws
72+
pytest tests/ --cov=maws --cov-report=term-missing --cov-report=xml
73+
74+
- name: Upload coverage to Codecov
75+
if: matrix.python-version == '3.10'
76+
uses: codecov/codecov-action@v4
77+
with:
78+
files: ./coverage.xml
79+
fail_ci_if_error: false
80+
verbose: true
81+
82+
# ============================================================================
83+
# Fast unit tests (no AmberTools needed)
84+
# ============================================================================
85+
unit-tests:
86+
name: Unit Tests Python ${{ matrix.python-version }}
87+
runs-on: ubuntu-latest
88+
89+
strategy:
90+
fail-fast: false
91+
matrix:
92+
python-version: ["3.10", "3.11", "3.12", "3.13"]
93+
94+
steps:
95+
- name: Checkout repository
96+
uses: actions/checkout@v4
97+
98+
- name: Setup Python
99+
uses: actions/setup-python@v5
100+
with:
101+
python-version: ${{ matrix.python-version }}
102+
cache: pip
103+
104+
- name: Install minimal dependencies
105+
run: |
106+
pip install numpy openmm mpmath pandas pytest pytest-cov
107+
108+
- name: Install package
109+
run: pip install -e .
110+
111+
- name: Run unit tests only
112+
run: |
113+
pytest tests/ -v --tb=short \
114+
--ignore=tests/test_chain_complex.py \
115+
--ignore=tests/test_run.py
116+
117+
# ============================================================================
118+
# GPU tests (only runs on self-hosted runners with NVIDIA GPU)
119+
# To enable: add a self-hosted runner with GPU and label 'gpu'
120+
# ============================================================================
121+
gpu-test:
122+
name: GPU Test
123+
runs-on: [self-hosted, gpu]
124+
if: github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, '[gpu]')
125+
continue-on-error: true # Don't fail the whole workflow if GPU tests fail
126+
127+
defaults:
128+
run:
129+
shell: bash -el {0}
130+
131+
steps:
132+
- name: Checkout repository
133+
uses: actions/checkout@v4
134+
135+
- name: Check NVIDIA GPU
136+
run: |
137+
nvidia-smi
138+
echo "CUDA devices found:"
139+
nvidia-smi --query-gpu=name,driver_version,memory.total --format=csv
140+
141+
- name: Setup Miniconda
142+
uses: conda-incubator/setup-miniconda@v3
143+
with:
144+
miniforge-version: latest
145+
python-version: "3.10"
146+
channels: conda-forge,bioconda,defaults
147+
channel-priority: strict
148+
activate-environment: maws-gpu
149+
auto-activate-base: false
150+
151+
- name: Install dependencies with CUDA support
152+
run: |
153+
conda activate maws-gpu
154+
# Install OpenMM with CUDA support
155+
conda install -y openmm cudatoolkit ambertools mpmath numba pandas numpy
156+
157+
- name: Install package
158+
run: |
159+
conda activate maws-gpu
160+
pip install -e ".[dev]"
161+
162+
- name: Verify CUDA platform
163+
run: |
164+
conda activate maws-gpu
165+
python -c "
166+
import openmm as mm
167+
print('Available platforms:')
168+
for i in range(mm.Platform.getNumPlatforms()):
169+
p = mm.Platform.getPlatform(i)
170+
print(f' {p.getName()}')
171+
try:
172+
cuda = mm.Platform.getPlatformByName('CUDA')
173+
print(f'CUDA platform found!')
174+
except Exception as e:
175+
print(f'CUDA not available: {e}')
176+
"
177+
178+
- name: Run all tests including GPU
179+
env:
180+
MAWS_OPENMM_PLATFORM: CUDA
181+
run: |
182+
conda activate maws-gpu
183+
pytest tests/ -v --tb=short -m "not slow"
184+
185+
# ============================================================================
186+
# Linting
187+
# ============================================================================
188+
lint:
189+
name: Lint
190+
runs-on: ubuntu-latest
191+
192+
steps:
193+
- name: Checkout repository
194+
uses: actions/checkout@v4
195+
196+
- name: Setup Python
197+
uses: actions/setup-python@v5
198+
with:
199+
python-version: "3.10"
200+
201+
- name: Install ruff
202+
run: pip install ruff
203+
204+
- name: Run ruff check
205+
run: ruff check maws/
206+
207+
- name: Run ruff format check
208+
run: ruff format --check maws/

.gitignore

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,6 @@ htmlcov/
4242
*.mo
4343
*.pot
4444

45-
# Django stuff:
46-
*.log
47-
local_settings.py
48-
db.sqlite3
49-
db.sqlite3-journal
50-
51-
# Flask stuff:
52-
instance/
53-
.webassets-cache
54-
55-
# Scrapy stuff:
56-
.scrapy
5745

5846
# Sphinx documentation
5947
docs/_build/
@@ -104,7 +92,9 @@ dmypy.json
10492
cython_debug/
10593

10694
#MAWS pdf files
107-
maws_*.pdb
10895
.maws_cache/
10996
*.in
110-
*.mdp
97+
*.mdp
98+
*.log
99+
*.lib
100+
# We have to correct all this before release

0 commit comments

Comments
 (0)