Skip to content

Commit

Permalink
use github actions instead of azure
Browse files Browse the repository at this point in the history
  • Loading branch information
lldelisle committed Dec 6, 2023
1 parent 00dd749 commit bcba0c6
Show file tree
Hide file tree
Showing 6 changed files with 145 additions and 89 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Pylint

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@main
with:
environment-file: ./HiCMatrix_env_ci.yml
cache-downloads: true
environment-name: HiCMatrix_env_ci
- name: Analysing the code with pylint
run: |
micromamba activate HiCMatrix_env_ci
# Disable
# C0103: Invalid name
# C0114: Missing module docstring
# C0115: Missing class docstring
# C0116: Missing function or method docstring
# C0301: Line too long
# C0302: Too many lines in module
# R0801: Similar lines
# R0902: Too many instance attributes
# R0904: Too many public methods
# R0912: Too many branches
# R0913: Too many arguments
# R0914: Too many local variables
# R0915: Too many statements
# R1702: Too many nested blocks
# R1728: Consider using a generator
pylint --disable C0103,C0114,C0115,C0116,C0301,C0302,R0801,R0902,R0904,R0912,R0913,R0914,R0915,R1702,R1728 $(git ls-files '*.py')
39 changes: 39 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@v1.8
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
52 changes: 52 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Test
on: [push, pull_request]

defaults:
run:
shell: bash -l {0}

jobs:
test-linux:
name: Test on Linux
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
steps:
- uses: actions/checkout@v3
- name: Use python ${{ matrix.python-version }}
run: echo " - python = ${{ matrix.python-version }}" >> ./HiCMatrix_env_ci.yml
- uses: mamba-org/setup-micromamba@main
with:
environment-file: ./HiCMatrix_env_ci.yml
cache-downloads: true
environment-name: HiCMatrix_env_ci
- name: pip install
run: |
micromamba activate HiCMatrix_env_ci
python3 -m pip install .
- name: Test HiCMatrix
run: |
micromamba activate HiCMatrix_env_ci
py.test hicmatrix/test/ --capture=sys
test-osx:
name: Test on OSX
runs-on: macOS-latest
steps:
- uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@main
with:
environment-file: ./HiCMatrix_env_ci.yml
cache-downloads: true
environment-name: HiCMatrix_env_ci
- name: pip install
run: |
micromamba activate HiCMatrix_env_ci
python3 -m pip install .
- name: Test HiCMatrix
run: |
micromamba activate HiCMatrix_env_ci
py.test hicmatrix/test/ --capture=sys
20 changes: 20 additions & 0 deletions HiCMatrix_env_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: HiCMatrix_env_ci
channels:
- conda-forge
- bioconda
dependencies:
- numpy >= 1.20
- scipy >= 1.2
- pandas >= 0.25
- pytables >= 3.5
- cooler >= 0.8.9
- intervaltree >= 3.0
- pytest
- flake8
- pytest-xdist
- pytest-forked
- nose
- pathlib
- configparser
- build # For the upload
- twine # For the upload
83 changes: 0 additions & 83 deletions azure-pipelines.yml

This file was deleted.

6 changes: 0 additions & 6 deletions requirements.txt

This file was deleted.

0 comments on commit bcba0c6

Please sign in to comment.