Improve IBD documentation and IdentitySegments docs #7427
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| pull_request: | |
| merge_group: | |
| push: | |
| branches: [main, test] | |
| 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.13 ] | |
| os: [ macos-latest, ubuntu-24.04, windows-latest ] | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Cancel Previous Runs | |
| uses: styfle/[email protected] | |
| with: | |
| access_token: ${{ github.token }} | |
| - name: Checkout | |
| uses: actions/[email protected] | |
| - name: Install OSX libs | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| brew install libxml2 libxslt | |
| - name: Fix windows symlinks | |
| working-directory: python | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| rm -r lib | |
| mkdir lib | |
| cp -r --dereference ../c/subprojects lib/. | |
| cp -r --dereference ../c/tskit lib/. | |
| cp ../c/tskit.h lib/. | |
| - 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 dependencies | |
| working-directory: python | |
| run: | | |
| uv venv | |
| uv pip install -r pyproject.toml --extra test | |
| # Remove tskit installed as a dep of msprime | |
| uv pip uninstall tskit | |
| - name: Build module | |
| working-directory: python | |
| run: | | |
| uv run --no-sync python setup.py build_ext --inplace | |
| - name: Minidom test | |
| working-directory: python | |
| # Importing either IPython or pytest causes import of xml.dom.minidom | |
| # So to actually test that tskit imports it, we need a minimal test | |
| run: | | |
| uv run --no-sync python -c "import tskit;tskit.Tree.generate_star(5).tree_sequence.draw_svg(path='test.svg')" | |
| - name: Run JIT code coverage | |
| working-directory: python | |
| run: | | |
| NUMBA_DISABLE_JIT=1 uv run --no-sync python -m pytest -x --cov=tskit --cov-report=xml --cov-branch -n2 tests/test_jit.py | |
| - name: Upload coverage to Codecov | |
| uses: codecov/[email protected] | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| working-directory: python | |
| fail_ci_if_error: false | |
| flags: python-tests-no-jit | |
| name: codecov-umbrella | |
| verbose: true | |
| - name: Run tests | |
| working-directory: python | |
| run: | | |
| if [[ "${{ matrix.os }}" == "windows-latest" ]]; then | |
| uv run --no-sync python -m pytest -x --skip-slow --cov=tskit --cov-report=xml --cov-branch -n2 --durations=20 tests | |
| else | |
| uv run --no-sync python -m pytest -x --cov=tskit --cov-report=xml --cov-branch -n2 --durations=20 tests | |
| fi | |
| - name: Upload coverage to Codecov | |
| uses: codecov/[email protected] | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| working-directory: python | |
| fail_ci_if_error: false | |
| flags: python-tests | |
| name: codecov-umbrella | |
| verbose: true | |
| test-numpy1: | |
| name: Numpy 1.x | |
| runs-on: ubuntu-24.04 | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Cancel Previous Runs | |
| uses: styfle/[email protected] | |
| with: | |
| access_token: ${{ github.token }} | |
| - name: Checkout | |
| uses: actions/[email protected] | |
| - name: Setup Python | |
| uses: actions/[email protected] | |
| with: | |
| python-version: '3.12' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| version: "0.8.15" | |
| - name: Install dependencies | |
| working-directory: python | |
| run: | | |
| uv venv | |
| uv pip install -r pyproject.toml --extra test | |
| uv pip uninstall tskit | |
| uv pip install "numpy<2" | |
| - name: Build module | |
| working-directory: python | |
| run: | | |
| uv run --no-sync python setup.py build_ext --inplace | |
| - name: Run tests with numpy 1.x | |
| working-directory: python | |
| run: | | |
| uv run --no-sync python -m pytest -x --cov=tskit --cov-report=xml --cov-branch -n2 tests/test_lowlevel.py tests/test_highlevel.py | |
| - name: Upload coverage to Codecov | |
| uses: codecov/[email protected] | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| working-directory: python | |
| fail_ci_if_error: false | |
| flags: python-tests-numpy1 | |
| name: codecov-numpy1 | |
| verbose: true | |
| msys2: | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - { sys: mingw32, env: i686 } | |
| - { sys: mingw64, env: x86_64 } | |
| name: Windows (${{ matrix.sys }}, ${{ matrix.env }}) | |
| defaults: | |
| run: | |
| shell: msys2 {0} | |
| steps: | |
| - name: Cancel Previous Runs | |
| uses: styfle/[email protected] | |
| with: | |
| access_token: ${{ github.token }} | |
| - name: 'Checkout' | |
| uses: actions/[email protected] | |
| - name: Setup MSYS2 ${{matrix.sys}} | |
| uses: msys2/[email protected] | |
| with: | |
| msystem: ${{matrix.sys}} | |
| update: true | |
| install: >- | |
| git | |
| mingw-w64-${{matrix.env}}-toolchain | |
| mingw-w64-${{matrix.env}}-ninja | |
| mingw-w64-${{matrix.env}}-meson | |
| mingw-w64-${{matrix.env}}-cunit | |
| - name: Build | |
| working-directory: c | |
| run: | | |
| meson build -Dbuild_examples=false | |
| ninja -C build | |
| - name: Run tests | |
| working-directory: c | |
| run: | | |
| ninja -C build test |