Skip to content

Commit

Permalink
feat(repo): initiate repository
Browse files Browse the repository at this point in the history
Establish workflow, after anonymising from previous work.
  • Loading branch information
rbpatt2019 committed Oct 27, 2021
0 parents commit 28ea197
Show file tree
Hide file tree
Showing 68 changed files with 2,950 additions and 0 deletions.
104 changes: 104 additions & 0 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: CI/CD
on:
push:
branches:
- '**'
pull_request:
branches:
- main

workflow_dispatch:

jobs:
py_check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache Nox
uses: actions/cache@v2
env:
CACHE_NUMBER: 1
with:
path: .nox
key:
${{ runner.os }}-nox-${{ env.CACHE_NUMBER }}-${{ hashFiles('noxfile.py') }}
- name: Setup Nox
uses: excitedleigh/setup-nox@v2.0.0
- name: black_isort_flake8_mypy
run: nox -s form lint type
- name: safety
run: nox -s security

snake_check:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache Conda
uses: actions/cache@v2
env:
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('workflow/envs/cicd_min.yaml') }}
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: cicd_min
channel-priority: strict
environment-file: workflow/envs/cicd_min.yaml
use-only-tar-bz2: true
miniforge-variant: Mambaforge
miniforge-version: 4.10.3-6
use-mamba: true
- name: Snakefmt_lint
run: |
snakemake --lint
snakefmt workflow
# - name: Snakemake unit tests
# run: pytest .tests/unit
# - name: Snakemake integration tests
# run: pytest .tests/integration
R_check:
# There is a cacheable install, but it requires a proper R package
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup R
uses: r-lib/actions/setup-r@v1
with:
r-version: "4.1.1"
use-public-rspm: true
- name: Install Dependencies
run: install.packages(c("lintr", "styler"))
shell: Rscript {0}
- name: lintr
run: lintr::lint_dir()
shell: Rscript {0}
- name: styler
run: styler::style_dir()
shell: Rscript {0}

release:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
needs: [py_check, snake_check, R_check]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Python Semantic Release
uses: relekang/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
143 changes: 143 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.envrc
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# Local things
/results
/data
/resources
/jobs
/.snakemake
/.conda
/.cache
/.config
/.nv
/.DS_store
report.html
60 changes: 60 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
default_stages: [commit]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-yaml
- id: check-toml
- id: fix-encoding-pragma
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files
args: ['--maxkb=5000']
- repo: https://github.com/PyCQA/isort
rev: 5.9.3
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 21.9b0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910-1
hooks:
- id: mypy
args: ['--ignore-missing-imports', '--disable-error-code', 'name-defined', '--disable-error-code', 'attr-defined']
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
entry: pflake8
additional_dependencies:
- flake8-annotations
- flake8-bandit
- flake8-bugbear
- flake8-comprehensions
- flake8-docstrings
- flake8-pytest-style
- flake8-spellcheck
- darglint
- pyproject-flake8
- repo: https://github.com/snakemake/snakefmt
rev: 0.4.4
hooks:
- id: snakefmt
- repo: local
hooks:
- id: snakelint
name: snakelint
language: system
files: 'workflow/Snakefile'
pass_filenames: false
entry: snakemake --lint
- repo: https://github.com/lorenzwalthert/precommit
rev: v0.1.3.9133
hooks:
- id: style-files
- id: parsable-R
- id: lintr
verbose: true
9 changes: 9 additions & 0 deletions .snakemake-workflow-catalog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
usage:
mandatory-flags:
desc: In order to take advantage of GPU acceleration, Singularity must be made aware of Nvidia
flags: "--singularity-args='--nv'"
software-stack-deployment:
conda: true
singularity: true
singularity+conda: true
report: true
Loading

0 comments on commit 28ea197

Please sign in to comment.