Skip to content

Tests

Tests #2521

Workflow file for this run

name: Tests
on:
pull_request:
push:
branches: [main, test]
merge_group:
jobs:
pre-commit:
name: Lint
uses: tskit-dev/.github/.github/workflows/lint.yml@v2
test:
name: Python
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python: [ "3.10", 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: Set up Python 3.10
uses: actions/setup-python@v6.1.0
with:
python-version: "${{ matrix.python }}"
- 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 pip deps
run: |
pip install uv
uv pip install --system -r pyproject.toml --extra test
- name: Build module
run: |
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: |
pytest -xvs -n0