Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 84 additions & 69 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,77 +30,92 @@ jobs:
additional-apt-packages: libgsl-dev
secrets: inherit


test-python:
name: Python
runs-on: ${{ matrix.os }}
uses: tskit-dev/.github/.github/workflows/python-tests.yml@main
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python }}
coverage-directory: msprime
secrets: inherit
strategy:
fail-fast: false
matrix:
python: [ 3.11, 3.14 ]
python: [ 3.11, 3.13 ]
os: [ macos-latest, ubuntu-24.04, windows-latest ]
defaults:
run:
shell: bash
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.13.0
with:
access_token: ${{ github.token }}

- name: Checkout
uses: actions/checkout@v6.0.2
with:
submodules: true

- name: Fix windows symlinks
# This is horrible, but the "git config core.symlinks true" didn't work.
if: matrix.os == 'windows-latest'
run: |
rm lwt_interface
cp -r --dereference git-submodules/tskit/python/lwt_interface ./lwt_interface

- name: Install GSL (macOS)
if: matrix.os == 'macos-latest'
run: brew install gsl

- name: Install GSL (Windows)
if: matrix.os == 'windows-latest'
run: |
vcpkg install gsl:x64-windows
# Add GSL DLL directory to PATH for runtime
$vcpkgRoot = $env:VCPKG_INSTALLATION_ROOT
if (-not $vcpkgRoot) { $vcpkgRoot = "C:\vcpkg" }
$gslBinPath = Join-Path $vcpkgRoot "installed\x64-windows\bin"
echo "$gslBinPath" >> $env:GITHUB_PATH
Write-Output "Added to PATH: $gslBinPath"
shell: powershell

- name: Install GSL (Ubuntu)
if: matrix.os == 'ubuntu-24.04'
run: sudo apt-get update && sudo apt-get install -y libgsl-dev

- name: Install uv and set the python version
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python }}
version: "0.8.15"

- name: Install Python dependencies
run: uv sync --locked --group test --no-default-groups

- name: Build module
run: uv run --no-default-groups python setup.py build_ext --inplace

- name: Fix windows gsl dlls
if: matrix.os == 'windows-latest'
run: cp /c/vcpkg/installed/x64-windows/bin/gsl*.dll msprime/

- name: Run tests
run: uv run --no-default-groups pytest --cov=msprime --cov-report=xml --cov-branch -n2

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5.4.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: python
fail_ci_if_error: true


# test-python:
# name: Python
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# python: [ 3.11, 3.14 ]
# os: [ macos-latest, ubuntu-24.04, windows-latest ]
# defaults:
# run:
# shell: bash
# steps:
# - name: Cancel Previous Runs
# uses: styfle/cancel-workflow-action@0.13.0
# with:
# access_token: ${{ github.token }}

# - name: Checkout
# uses: actions/checkout@v6.0.2
# with:
# submodules: true

# - name: Fix windows symlinks
# # This is horrible, but the "git config core.symlinks true" didn't work.
# if: matrix.os == 'windows-latest'
# run: |
# rm lwt_interface
# cp -r --dereference git-submodules/tskit/python/lwt_interface ./lwt_interface

# - name: Install GSL (macOS)
# if: matrix.os == 'macos-latest'
# run: brew install gsl

# - name: Install GSL (Windows)
# if: matrix.os == 'windows-latest'
# run: |
# vcpkg install gsl:x64-windows
# # Add GSL DLL directory to PATH for runtime
# $vcpkgRoot = $env:VCPKG_INSTALLATION_ROOT
# if (-not $vcpkgRoot) { $vcpkgRoot = "C:\vcpkg" }
# $gslBinPath = Join-Path $vcpkgRoot "installed\x64-windows\bin"
# echo "$gslBinPath" >> $env:GITHUB_PATH
# Write-Output "Added to PATH: $gslBinPath"
# shell: powershell

# - name: Install GSL (Ubuntu)
# if: matrix.os == 'ubuntu-24.04'
# run: sudo apt-get update && sudo apt-get install -y libgsl-dev

# - name: Install uv and set the python version
# uses: astral-sh/setup-uv@v6
# with:
# python-version: ${{ matrix.python }}
# version: "0.8.15"

# - name: Install Python dependencies
# run: uv sync --locked --group test --no-default-groups

# - name: Build module
# run: uv run --no-default-groups python setup.py build_ext --inplace

# - name: Fix windows gsl dlls
# if: matrix.os == 'windows-latest'
# run: cp /c/vcpkg/installed/x64-windows/bin/gsl*.dll msprime/

# - name: Run tests
# run: uv run --no-default-groups pytest --cov=msprime --cov-report=xml --cov-branch -n2

# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v5.4.0
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# flags: python
# fail_ci_if_error: true
Loading