Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MinGW version of pysam #1274

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
381 changes: 225 additions & 156 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,156 +1,225 @@
name: CI

on: [push, pull_request]

jobs:
direct:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ubuntu, macos]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
exclude:
# Run only the latest few 3.x versions on macOS
- os: macos
python-version: 3.7
- os: macos
python-version: 3.8
- os: macos
python-version: 3.9

steps:
- name: Checkout pysam
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install prerequisite Python libraries
run: pip install cython pytest pytest-pep8 setuptools

- name: Install Linux build prerequisites
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -q --no-install-recommends --no-install-suggests libcurl4-openssl-dev

- name: Update macOS build prerequisites
if: runner.os == 'macOS'
run: |
brew unlink xz || true # Remove brewed liblzma as it is not multiarch

- name: Build (directly from checkout)
run: python setup.py build

- name: Install test prerequisites
run: |
case $RUNNER_OS in
Linux)
sudo apt-get install -q --no-install-recommends --no-install-suggests samtools bcftools tabix
;;
macOS)
brew install -q samtools bcftools
;;
esac

- name: Run tests
run: |
export PYTHONPATH=$(echo $GITHUB_WORKSPACE/build/lib.*)
export REF_PATH=':'
pytest


sdist:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ubuntu, macos]
python-version: ['3.10']

steps:
- name: Checkout pysam
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install prerequisite Python libraries
run: pip install cython pytest pytest-pep8

- name: Install build prerequisites
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -q --no-install-recommends --no-install-suggests libcurl4-openssl-dev

- name: Create source distribution
run: python setup.py sdist --owner=root --group=root

- name: Build (via sdist tarball)
run: pip install --verbose --no-deps --no-binary=':all:' pysam-*.tar.gz
working-directory: dist

- name: Install test prerequisites
run: |
case $RUNNER_OS in
Linux)
sudo apt-get install -q --no-install-recommends --no-install-suggests samtools bcftools tabix
;;
macOS)
brew install -q samtools bcftools
;;
esac

- name: Run tests
run: REF_PATH=':' pytest

- name: Upload sdist tarball
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: sdist
path: dist/pysam-*.tar.gz
retention-days: 14


conda:
timeout-minutes: 20
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ubuntu]
python-version: ['3.7']
defaults:
run:
shell: bash -l {0} # needed for conda activation
env:
HTSLIB_CONFIGURE_OPTIONS: "--disable-libcurl"

steps:
- name: Checkout pysam
uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v2
with:
channel-priority: strict
activate-environment: testenv
auto-activate-base: false
use-only-tar-bz2: true

- name: Set up Conda and Python ${{ matrix.python-version }}
run: |
conda config --add channels bioconda --add channels conda-forge
conda install python=${{ matrix.python-version }} cython

- name: Build (directly from checkout)
run: python setup.py install

- name: Install test prerequisites via Conda
run: conda install "samtools>=1.11" "bcftools>=1.11" "htslib>=1.11" pytest

- name: Run tests
run: REF_PATH=':' pytest
name: CI

on: [push, pull_request]

jobs:
direct:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ubuntu, macos, windows]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
include:
# Add specific configuration for Windows
- os: windows
msystem: ucrt64
exclude:
# Run only the latest few 3.x versions on macOS
- os: macos
python-version: '3.7'
- os: macos
python-version: '3.8'
- os: macos
python-version: '3.9'
- os: macos
python-version: '3.10'
- os: macos
python-version: '3.11'
- os: macos
python-version: '3.12'
# Exclude all Windows Python versions except 3.11
- os: windows
python-version: '3.7'
- os: windows
python-version: '3.8'
- os: windows
python-version: '3.9'
- os: windows
python-version: '3.10'
- os: windows
python-version: '3.12'

steps:
- name: Checkout pysam
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
if: runner.os != 'Windows'
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install prerequisite Python libraries
if: runner.os != 'Windows'
run: pip install cython pytest pytest-pep8 setuptools

- name: Install Linux build prerequisites
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -q --no-install-recommends --no-install-suggests libcurl4-openssl-dev

- name: Update macOS build prerequisites
if: runner.os == 'macOS'
run: |
brew unlink xz || true

- name: Install MSYS2 build prerequisites
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
with:
msystem: ucrt64
update: true
install: >-
base-devel
mingw-w64-ucrt-x86_64-toolchain
mingw-w64-ucrt-x86_64-cython
mingw-w64-ucrt-x86_64-python
mingw-w64-ucrt-x86_64-python-pip
mingw-w64-ucrt-x86_64-python-setuptools
mingw-w64-ucrt-x86_64-curl
mingw-w64-ucrt-x86_64-libdeflate
mingw-w64-ucrt-x86_64-bzip2
mingw-w64-ucrt-x86_64-zlib
mingw-w64-ucrt-x86_64-python-pytest
mingw-w64-ucrt-x86_64-xz
mingw-w64-ucrt-x86_64-openssl
mingw-w64-ucrt-x86_64-libtre-git
mingw-w64-ucrt-x86_64-libiconv

- name: Build (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
python setup.py build

- name: Build (Unix)
if: runner.os != 'Windows'
run: |
python setup.py build

- name: Install test prerequisites (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
pacman -S --noconfirm mingw-w64-ucrt-x86_64-samtools mingw-w64-ucrt-x86_64-bcftools

- name: Install test prerequisites (Unix)
if: runner.os != 'Windows'
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install -q --no-install-recommends --no-install-suggests samtools bcftools tabix
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install -q samtools bcftools
fi

- name: Run tests (Windows)
if: runner.os == 'Windows'
shell: msys2 {0}
run: |
export PYTHONPATH=$(echo $GITHUB_WORKSPACE/build/lib.*)
export REF_PATH=':'
pytest

- name: Run tests (Unix)
if: runner.os != 'Windows'
shell: bash
run: |
export PYTHONPATH=$(echo $GITHUB_WORKSPACE/build/lib.*)
export REF_PATH=':'
pytest


sdist:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ubuntu]
python-version: ['3.10']

steps:
- name: Checkout pysam
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install prerequisite Python libraries
run: pip install cython pytest pytest-pep8

- name: Install build prerequisites
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -q --no-install-recommends --no-install-suggests libcurl4-openssl-dev

- name: Create source distribution
run: python setup.py sdist --owner=root --group=root

- name: Build (via sdist tarball)
run: pip install --verbose --no-deps --no-binary=':all:' pysam-*.tar.gz
working-directory: dist

- name: Install test prerequisites
run: |
case $RUNNER_OS in
Linux)
sudo apt-get install -q --no-install-recommends --no-install-suggests samtools bcftools tabix
;;
macOS)
brew install -q samtools bcftools
;;
esac

- name: Run tests
run: REF_PATH=':' pytest

- name: Upload sdist tarball
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: sdist
path: dist/pysam-*.tar.gz
retention-days: 14


conda:
timeout-minutes: 20
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ubuntu]
python-version: ['3.7']
defaults:
run:
shell: bash -l {0} # needed for conda activation
env:
HTSLIB_CONFIGURE_OPTIONS: "--disable-libcurl"

steps:
- name: Checkout pysam
uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v2
with:
channel-priority: strict
activate-environment: testenv
auto-activate-base: false
use-only-tar-bz2: true

- name: Set up Conda and Python ${{ matrix.python-version }}
run: |
conda config --add channels bioconda --add channels conda-forge
conda install python=${{ matrix.python-version }} cython

- name: Build (directly from checkout)
run: python setup.py install

- name: Install test prerequisites via Conda
run: conda install "samtools>=1.11" "bcftools>=1.11" "htslib>=1.11" pytest

- name: Run tests
run: REF_PATH=':' pytest
Loading