Skip to content

Commit

Permalink
GitHub Actions (GHA) CI setup (#793)
Browse files Browse the repository at this point in the history
Configure a CI workflow based on tox.

Install the R package DNAcopy differently on Linux and Mac OS:
- Linux: apt for compiled dependencies and DNAcopy
- macOS: brew for dependencies, then callR.org for DNAcopy

Some matrix options are left commented out:
- Python 3.11: upstream issue cython/cython#4461 prevents pysam and pomegranate from compiling
- Latest Python `-min`: known runtime failure due to numpy compiled-for-xyz binary incompatility
- Typing: mypy runs successfully and reports known errors; CNVkit codebase needs an overhaul

Python 3.11 and Typing configs are still available in tox.ini for local testing.
  • Loading branch information
etal committed Feb 22, 2023
1 parent 42ed407 commit 3904681
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 3 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/tests-tox.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Tests
on:
push:
branches:
- master
paths-ignore:
- 'docs/**'
- '*.md'
- '*.rst'
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
- '*.rst'
jobs:
tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# - {name: '3.11', python: '3.11', os: ubuntu-latest, tox: py311}
# - {name: '3.11-MacOS', python: '3.11', os: macos-latest, tox: py311}
# - {name: '3.11-min', python: '3.11', os: ubuntu-latest, tox: "py311-min"}
- {name: '3.10', python: '3.10', os: ubuntu-latest, tox: py310}
- {name: '3.10-MacOS', python: '3.10', os: macos-latest, tox: py310}
- {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39}
- {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38}
- {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37}
- {name: '3.7-min', python: '3.7', os: ubuntu-latest, tox: "py37-min"}
# - {name: Typing, python: '3.10', os: ubuntu-latest, tox: typing}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: 'pip'
cache-dependency-path: 'requirements/*.txt'
- name: Update pip
run: |
pip install -U setuptools wheel
python -m pip install -U pip
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt-get install -y liblzma-dev python3-dev python3-numpy python3-matplotlib r-bioc-dnacopy zlib1g-dev
- name: Install Mac OS dependencies
if: runner.os == 'macOS'
run: |
brew install r
Rscript --no-environ -e "source('http://callr.org/install#DNAcopy')"
- run: pip install tox
- run: tox -e ${{ matrix.tox }}

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ source = ["cnvlib", "skgenome", "tests"]
source = ["cnvlib", "skgenome"]

[tool.mypy]
python_version = "3.7"
python_version = "3.10"
files = ["src/flask"]
show_error_codes = true
pretty = true
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist =
py3{10,9,8,7}
py310-min
py3{11,10,9,8,7}
py311-min
py37-min
typing
#docs
Expand Down

0 comments on commit 3904681

Please sign in to comment.