Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
190 changes: 176 additions & 14 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies and run tests
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
# This workflow will install Python dependencies, build simuPOP, and run tests
# across multiple platforms (Linux, macOS, Windows) and Python versions.

name: SimuPOP
name: simuPOP CI

on:
push:
Expand All @@ -13,30 +13,192 @@ permissions:
contents: read

jobs:
build:
build-linux:
runs-on: ubuntu-latest
timeout-minutes: 60
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
# - name: Install boost
# run: |
# sudo apt-get install libboost1.74-all-dev
# ln -s /usr/include/boost/ ./boost_1_74_0
- name: Install dependencies

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y swig zlib1g-dev cmake ninja-build

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install build scikit-build-core cmake ninja
pip install -r requirements.txt
- name: Install simuPOP
run: python setup.py install
- name: Run tests

- name: Build and install simuPOP
run: pip install -v .

- name: Run tests (short allele type)
run: python ./test/run_tests.py short -j2

- name: Run tests (binary allele type)
run: python ./test/run_tests.py binary -j2

build-macos-intel:
runs-on: macos-13
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install system dependencies
run: |
brew install swig libomp cmake ninja

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install build scikit-build-core cmake ninja
pip install -r requirements.txt

- name: Build and install simuPOP
env:
OpenMP_ROOT: /usr/local/opt/libomp
run: pip install -v .

- name: Run tests (short allele type)
run: python ./test/run_tests.py short -j2

- name: Run tests (binary allele type)
run: python ./test/run_tests.py binary -j2

build-macos-arm:
runs-on: macos-14
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install system dependencies
run: |
brew install swig libomp cmake ninja

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install build scikit-build-core cmake ninja
pip install -r requirements.txt

- name: Build and install simuPOP
env:
OpenMP_ROOT: /opt/homebrew/opt/libomp
run: pip install -v .

- name: Run tests (short allele type)
run: python ./test/run_tests.py short -j2

- name: Run tests (binary allele type)
run: python ./test/run_tests.py binary -j2

build-windows:
runs-on: windows-latest
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install SWIG
run: choco install swig -y

- name: Install zlib via vcpkg (static)
run: |
vcpkg install zlib:x64-windows-static

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install build scikit-build-core cmake ninja
pip install -r requirements.txt

- name: Build and install simuPOP
run: |
$toolchain = "$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake"
pip install -v . --config-settings=cmake.args="-DCMAKE_TOOLCHAIN_FILE=$toolchain;-DVCPKG_TARGET_TRIPLET=x64-windows-static"

- name: Run tests (short allele type)
run: python ./test/run_tests.py short -j2

- name: Run tests (binary allele type)
run: python ./test/run_tests.py binary -j2

# Full test suite on Linux (all allele types)
full-tests-linux:
runs-on: ubuntu-latest
timeout-minutes: 180
needs: build-linux
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y swig zlib1g-dev cmake ninja-build

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install build scikit-build-core cmake ninja
pip install -r requirements.txt

- name: Build and install simuPOP
run: pip install -v .

- name: Run all tests
run: python ./test/run_tests.py
Loading
Loading