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
135 changes: 135 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: CI/CD
on:
push:
branches: [ "master", "develop" ]
pull_request:
branches: [ "master", "develop" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
ci_pip:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}

steps:

- name: Cleanup build folder 🧹
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./

- name: Setup Python 3.12 🐍
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Setup backend 🏗️
run: |
pip install uv
uv pip install --system hatch pytest pytest-rerunfailures autoflake==1.7 isort==6.0 black==25.1

- name: Checkout 🛎️
uses: actions/checkout@v4

# Builds a wheel needed for the CD
- name: Build wheel 🎡
run: hatch build -t wheel

# Store the wheel in GitHub Actions
- name: Upload artifact ❄️
uses: actions/upload-artifact@v4
with:
name: genomepy_wheel
path: dist/

# Test if the created wheel can be installed
- name: Install 🛠️
run: uv pip install --system dist/*.whl --force-reinstall

- name: Unit tests 📜
run: pytest -vvv --reruns 1 --reruns-delay 10 tests/test_01_basic.py

- name: Integration tests 📚
run: |
genomepy --help
genomepy annotation --help
genomepy install --help
genomepy search --help

ci_conda:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}

steps:

- name: Cleanup build folder 🧹
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./

- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Setup backend 🏗️
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: environment.yml
miniforge-version: latest

- name: Install 🛠️
run: pip install . --no-deps --ignore-installed

- name: Unit tests 📜
run: pytest -vvv --reruns 1 --reruns-delay 10 tests/test_01_basic.py

- name: Integration tests 📚
run: |
genomepy --help
genomepy annotation --help
genomepy install --help
genomepy search --help

cd:
needs: ci_pip
runs-on: ubuntu-latest
# Only run this job if new work is pushed to "master"
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
# # Only run this job on a tagged commit
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')

steps:

- name: Cleanup build folder 🧹
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./

- name: Setup Python 3.12 🐍
uses: actions/setup-python@v5
with:
python-version: 3.12

- run: mkdir -p dist

- name: Download artifact ❄️
uses: actions/download-artifact@v4
with:
name: genomepy_wheel
path: dist/

- name: Publish to PyPI 🚀
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
10 changes: 5 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: Build and Deploy
name: Documentation
on:
push:
branches:
- master
- docs # backdoor branch to update docs
branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install & Build 📜
run: |
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ env:

before_install:
# setup mambaforge
- wget -q -O Mambaforge.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh"
- bash Mambaforge.sh -b -p "${HOME}/conda" > /dev/null
- wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
- bash Miniforge3.sh -b -p "${HOME}/conda" > /dev/null
- source "${HOME}/conda/etc/profile.d/conda.sh"
- source "${HOME}/conda/etc/profile.d/mamba.sh"
- mamba activate
Expand Down
6 changes: 3 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies:
- click
- colorama
- filelock >=3.5
- libsqlite <3.49 # v3.49.1: no column "size" (this is a diskcache requirement)
# - libsqlite <3.49 # v3.49.1: no column "size" (this is a diskcache requirement)
- loguru
- mygene
- mysql <=8.4 # 9.3: 'mysql_native_password' cannot be loaded
Expand Down Expand Up @@ -49,8 +49,8 @@ dependencies:
# Testing
- autoflake =1.7
- black =25.1
- flake8 =4.0
- flake8-bugbear =23.3
# - flake8 =4.0
# - flake8-bugbear =23.3
# - flakeheaven # v3.3.0 does not work with python 3.12
- isort =6.0
- pytest
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dependencies = [
"mygene",
"mysql-connector-python",
"norns >=0.1.6",
"setuptools; python_version >= '3.12'", # norns uses pkg_resources
"numpy",
"pandas",
"pyfaidx >=0.7.2.1",
Expand Down
Loading