Skip to content

Post-release tasks #546

Post-release tasks

Post-release tasks #546

Workflow file for this run

name: Tests
on:
pull_request:
push:
branches: [main]
merge_group:
jobs:
packaging:
name: Python packaging
uses: tskit-dev/.github/.github/workflows/python-packaging.yml@v15
test:
name: Python
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: ["3.11", "3.13"]
os: [macos-latest, ubuntu-24.04, windows-latest]
sys: [mingw64, ucrt64]
env: [x86_64, ucrt-x86_64]
exclude:
- os: macos-latest
sys: ucrt64
- os: macos-latest
sys: mingw64
env: ucrt-x86_64
- os: ubuntu-24.04
sys: ucrt64
- os: ubuntu-24.04
sys: mingw64
env: ucrt-x86_64
- os: windows-latest
sys: ucrt64
env: x86_64
- os: windows-latest
sys: mingw64
env: ucrt-x86_64
defaults:
run:
shell: bash -l {0}
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Install Conda
uses: mamba-org/setup-micromamba@v2.0.4
with:
environment-name: anaconda-client-env
cache-environment: true
create-args: |
python=${{ matrix.python }}
- name: Setup MSYS2 ${{matrix.sys}}
uses: msys2/setup-msys2@v2.27.0
if: matrix.os == 'windows-latest'
with:
msystem: ${{matrix.sys}}
release: false
install: >-
git
base-devel
msys2-devel
mingw-w64-${{matrix.env}}-zstd
mingw-w64-${{matrix.env}}-zlib
mingw-w64-${{matrix.env}}-toolchain
mingw-w64-${{matrix.env}}-cmake
mingw-w64-${{matrix.env}}-autotools
- name: Cache SLiM build
if: matrix.os == 'windows-latest'
id: cache-slim
uses: actions/cache@v4.2.2
with:
path: D:\a\pyslim\pyslim\SLiM
key: ${{runner.os}}-${{matrix.sys}}-${{matrix.env}}-key
- name: Build SLiM (Windows)
if: matrix.os == 'windows-latest' && steps.cache-slim.outputs.cache-hit != 'true'
shell: msys2 {0}
run: |
git clone https://github.com/messerlab/SLiM.git
mkdir -p SLiM/Release
cd SLiM/windows_compat/gnulib
touch --date="`date`" aclocal.m4 Makefile.am configure configure.ac config.h.in Makefile.in
cd ../..
cd Release
cmake -G"MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release ..
make -j 2
- name: Install uv and dependencies
run: |
pip install uv
uv sync --locked --group test --no-default-groups
- name: Install SLiM (macOS / Linux)
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-24.04'
run: micromamba install slim -y
- name: Run tests
run: |
export PATH=$PWD/SLiM/Release:$PATH
uv run --no-default-groups --group test pytest \
-n 0 -v \
--cov=pyslim --cov-branch \
--cov-report=xml \
tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5.4.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
flags: python-tests
files: coverage.xml
disable_search: true
verbose: true