Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Dependabot Configuration
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates

version: 2
updates:
# Python dependencies
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "python"
commit-message:
prefix: "deps(python)"
groups:
python-minor:
patterns: ["*"]
update-types: ["minor", "patch"]

# Rust dependencies
- package-ecosystem: "cargo"
directory: "/rust"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "rust"
commit-message:
prefix: "deps(rust)"
groups:
rust-minor:
patterns: ["*"]
update-types: ["minor", "patch"]

# GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 3
labels:
- "dependencies"
- "ci"
commit-message:
prefix: "ci(deps)"
199 changes: 199 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
name: CI

on:
push:
branches: [master, main, develop]
pull_request:
branches: [master, main]
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1

jobs:
test:
name: Test (Python ${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
exclude:
# Reduce macOS matrix for faster CI
- os: macos-latest
python-version: '3.9'

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-

- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y bcftools bedtools samtools

- name: Install system dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install bcftools bedtools samtools

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install maturin pytest pytest-cov numpy pandas polars scipy pysam pybedtools anndata scanpy typer rich

- name: Build Rust extension
run: |
maturin develop --release -m rust/Cargo.toml

- name: Run tests with coverage
run: |
pytest tests/ -v --tb=short --cov=src --cov-report=xml --cov-report=term-missing
env:
PYTHONPATH: ${{ github.workspace }}/src

- name: Upload coverage to Codecov
if: matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: unittests
name: codecov-wasp2
fail_ci_if_error: false
verbose: true

lint:
name: Lint & Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'

- name: Install linters
run: |
pip install black flake8 mypy

- name: Check formatting with Black
run: black --check --diff --line-length 100 src/ tests/
continue-on-error: true

- name: Lint with Flake8
run: flake8 src/ tests/ --max-line-length=100 --ignore=E501,W503,E203 --count --statistics
continue-on-error: true

- name: Type check with mypy
run: mypy src/counting/ src/mapping/ src/analysis/ --ignore-missing-imports
continue-on-error: true

rust-check:
name: Rust Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt

- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-rust-check-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-rust-check-

- name: Check Rust compilation
working-directory: rust
run: cargo check --all-targets

- name: Clippy lints
working-directory: rust
run: cargo clippy --all-targets -- -D warnings
continue-on-error: true

- name: Check Rust formatting
working-directory: rust
run: cargo fmt --check
continue-on-error: true

build:
name: Build Package
runs-on: ubuntu-latest
needs: [test, lint, rust-check]
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'

- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-

- name: Install build dependencies
run: |
pip install build twine maturin

- name: Build wheels with maturin
run: |
maturin build --release -m rust/Cargo.toml

- name: Check package
run: |
twine check target/wheels/*.whl

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-linux
path: target/wheels/*.whl
retention-days: 7
53 changes: 53 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build and Deploy Docs

on:
push:
branches: [master, main, develop]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'

- name: Install dependencies
run: |
pip install sphinx pydata-sphinx-theme sphinx-autodoc-typehints
pip install numpy pandas polars scipy typer rich

- name: Build docs
run: |
cd docs
make html

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/build/html

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Loading
Loading