Skip to content

Commit

Permalink
Try setting up CI for Python bindings tests (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
sampsyo authored May 15, 2024
2 parents 18b2825 + 0e7a6af commit f8580c7
Show file tree
Hide file tree
Showing 2 changed files with 167 additions and 0 deletions.
148 changes: 148 additions & 0 deletions .github/workflows/flatgfa-py.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# This file is autogenerated by maturin v1.5.1
# To update, run
#
# maturin generate-ci github --pytest -m flatgfa-py/Cargo.toml -o .github/workflows/flatgfa-py.yml
#
name: flatgfa-py CI

on:
push:
branches:
- main
pull_request:
paths:
- "flatgfa-py/**"

permissions:
contents: read

jobs:
linux:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-latest
target: x86_64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --manifest-path flatgfa-py/Cargo.toml
sccache: "true"
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.platform.target }}
path: dist
- name: pytest
if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
shell: bash
run: |
set -e
pip install flatgfa --find-links dist --force-reinstall
pip install pytest
cd flatgfa-py && pytest
windows:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: windows-latest
target: x64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
architecture: ${{ matrix.platform.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --manifest-path flatgfa-py/Cargo.toml
sccache: "true"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-windows-${{ matrix.platform.target }}
path: dist
- name: pytest
if: ${{ !startsWith(matrix.platform.target, 'aarch64') }}
shell: bash
run: |
set -e
pip install flatgfa --find-links dist --force-reinstall
pip install pytest
cd flatgfa-py && pytest
macos:
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: macos-latest
target: x86_64
- runner: macos-latest
target: aarch64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --manifest-path flatgfa-py/Cargo.toml
sccache: "true"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-macos-${{ matrix.platform.target }}
path: dist
- name: pytest
if: ${{ startsWith(matrix.platform.target, 'aarch64') }}
shell: bash
run: |
set -e
pip install flatgfa --find-links dist --force-reinstall
pip install pytest
cd flatgfa-py && pytest
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist --manifest-path flatgfa-py/Cargo.toml
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: dist

release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, windows, macos, sdist]
steps:
- uses: actions/download-artifact@v4
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*
19 changes: 19 additions & 0 deletions flatgfa-py/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
[project]
name = "flatgfa"
version = "0.1.0"
description = "efficient processing of pangenomes in Graphical Fragment Assembly (GFA) format"
readme = "README.md"
requires-python = ">=3.8"
license = "MIT"
keywords = ["genomics", "pangenomics", "gfa"]
classifiers = [
"Scientific/Engineering :: Bio-Informatics",
"OSI Approved :: MIT License",
]

[project.urls]
repository = "https://github.com/cucapra/pollen"

[project.optional-dependencies]
test = ["pytest"]

[build-system]
requires = ["maturin>=1.0,<2.0"]
build-backend = "maturin"
Expand Down

0 comments on commit f8580c7

Please sign in to comment.