Skip to content

Commit f4c3a7c

Browse files
committed
ensure testing on different architectures
1 parent e3a9059 commit f4c3a7c

1 file changed

Lines changed: 47 additions & 4 deletions

File tree

.github/workflows/build_and_test_package.yml

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,19 @@ on:
1111

1212
jobs:
1313
test:
14-
name: Test Python ${{ matrix.python-version }}
15-
runs-on: ubuntu-latest
14+
name: Test Python ${{ matrix.python-version }} on ${{ matrix.os }}
15+
runs-on: ${{ matrix.os }}
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
19+
os: [ubuntu-latest, macos-latest, windows-latest]
20+
python-version: ["3.8", "3.10", "3.12"]
21+
# Test fewer Python versions per OS to keep CI time reasonable
22+
# Full matrix: 3 OS × 3 Python versions = 9 jobs
23+
exclude:
24+
# On Windows, skip Python 3.8 (OpenMM compatibility issues)
25+
- os: windows-latest
26+
python-version: "3.8"
2027

2128
steps:
2229
- name: Checkout code
@@ -33,6 +40,7 @@ jobs:
3340

3441
- name: Install dependencies
3542
shell: bash -l {0}
43+
if: matrix.os != 'windows-latest'
3644
run: |
3745
conda info
3846
conda list
@@ -42,9 +50,29 @@ jobs:
4250
pip install pytest>=6.0 pytest-cov>=2.10 flake8>=3.8
4351
# Install package in editable mode
4452
pip install -e .
53+
54+
- name: Install dependencies (Windows)
55+
shell: cmd
56+
if: matrix.os == 'windows-latest'
57+
run: |
58+
conda info
59+
conda list
60+
conda install -y numpy>=1.20.0 scipy>=1.7.0 openmm>=7.7.0
61+
pip install pytest>=6.0 pytest-cov>=2.10 flake8>=3.8
62+
pip install -e .
4563
4664
- name: Display installed packages
4765
shell: bash -l {0}
66+
if: matrix.os != 'windows-latest'
67+
run: |
68+
conda list
69+
python -c "import openmm; print(f'OpenMM version: {openmm.__version__}')"
70+
python -c "import numpy; print(f'NumPy version: {numpy.__version__}')"
71+
python -c "import scipy; print(f'SciPy version: {scipy.__version__}')"
72+
73+
- name: Display installed packages (Windows)
74+
shell: cmd
75+
if: matrix.os == 'windows-latest'
4876
run: |
4977
conda list
5078
python -c "import openmm; print(f'OpenMM version: {openmm.__version__}')"
@@ -53,22 +81,37 @@ jobs:
5381
5482
- name: Lint with flake8
5583
shell: bash -l {0}
84+
if: matrix.os != 'windows-latest'
5685
run: |
5786
# Stop the build if there are Python syntax errors or undefined names
5887
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=.git,__pycache__,build,dist,.eggs
5988
# Exit-zero treats all errors as warnings
6089
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=.git,__pycache__,build,dist,.eggs
90+
91+
- name: Lint with flake8 (Windows)
92+
shell: cmd
93+
if: matrix.os == 'windows-latest'
94+
run: |
95+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=.git,__pycache__,build,dist,.eggs
96+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=.git,__pycache__,build,dist,.eggs
6197
6298
- name: Test with pytest
6399
shell: bash -l {0}
100+
if: matrix.os != 'windows-latest'
64101
run: |
65102
# pytest automatically discovers and runs unittest-based tests
66103
# Run from project root to match local test script behavior
67104
# Use same test discovery as local script (unittest-based)
68105
pytest test/ -v --tb=short --color=yes --cov=ringclosingmm --cov-report=term --cov-report=xml --ignore-glob="*__pycache__*"
106+
107+
- name: Test with pytest (Windows)
108+
shell: cmd
109+
if: matrix.os == 'windows-latest'
110+
run: |
111+
pytest test/ -v --tb=short --color=yes --cov=ringclosingmm --cov-report=term --cov-report=xml --ignore-glob="*__pycache__*"
69112
70113
- name: Upload coverage to Codecov
71-
if: matrix.python-version == '3.10'
114+
if: matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest'
72115
uses: codecov/codecov-action@v3
73116
with:
74117
file: ./coverage.xml

0 commit comments

Comments
 (0)