Skip to content

Commit

Permalink
Merge pull request #75 from uab-cgds-worthey/cicd_system_testing
Browse files Browse the repository at this point in the history
Adds system testing workflow to github actions
  • Loading branch information
ManavalanG authored Jun 21, 2023
2 parents 91894f5 + 0e0ceec commit 6eab6c9
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- [ ] Is this a feature addition? Briefly describe.
- [ ] Did you modify QuaC-Watch config file? If so, did you modify multiqc template
`configs/multiqc_config_template.jinja2` and script `src/quac_watch/create_mutliqc_configs.py` as necessary?
- [ ] Did you perform system-level testing manually as described in master readme doc? Did it pass completely? If not why?
- [ ] Did you perform system-level testing manually, using `--subtasks_slurm` flag, as described in the [documentation](https://quac.readthedocs.io/en/stable/system_testing/)? Did it pass completely? If not why?
- [ ] Updated `Changelog.md` file with change logs in recommended format?


Expand Down
138 changes: 138 additions & 0 deletions .github/workflows/system_testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
name: system_testing
on:
push:
paths:
- ".github/workflows/system_testing.yml"
- ".test/**"
- "configs/**"
- "src/**"
- "workflow/**"
pull_request:
paths:
- ".github/workflows/system_testing.yml"
- ".test/**"
- "configs/**"
- "src/**"
- "workflow/**"
types:
- opened
# - synchronize
- reopened
- ready_for_review
- converted_to_draft
workflow_dispatch:

jobs:
system-testing:
name: System testing - QuaC
runs-on: ubuntu-20.04
defaults:
run:
shell: bash -l {0}

steps:
- name: Frees Disk Space (Ubuntu)
# For more info about this task, see https://github.com/uab-cgds-worthey/quac/issues/78
uses: jlumbroso/free-disk-space@v1.2.0
with:
# this might remove tools that are actually needed, when set to "true"
tool-cache: true

- name: Checkout repository
uses: actions/checkout@v2

- name: Create quac environment
uses: conda-incubator/setup-miniconda@v2
with:
mamba-version: "*"
channels: conda-forge,bioconda,defaults
auto-activate-base: false
activate-environment: quac
environment-file: configs/env/quac.yaml

- name: Check conda solution
run: |
mamba env export
- name: Check snakemake exists in conda env
run: |
which snakemake
snakemake --version
- uses: eWaterCycle/setup-singularity@v7
with:
singularity-version: 3.8.3

- name: Check singularity is working
run: |
singularity --version
- name: Set up dependencies for QuaC
run: |
bash src/setup_dependency_datasets.sh
- name: Run QuaC system testing - WGS mode AND no prior QC data
run: |
PROJECT_CONFIG="project_2samples"
PRIOR_QC_STATUS="no_priorQC"
USE_SLURM=""
python src/run_quac.py \
--project_name test_project \
--projects_path ".test/ngs-data/" \
--pedigree ".test/configs/${PRIOR_QC_STATUS}/${PROJECT_CONFIG}.ped" \
--outdir "data/quac/results/test_${PROJECT_CONFIG}_wgs-${PRIOR_QC_STATUS}/analysis" \
--quac_watch_config "configs/quac_watch/wgs_quac_watch_config.yaml" \
--workflow_config "configs/workflow.yaml" \
$USE_SLURM \
|| df -h
- name: Run QuaC system testing - Exome mode AND no prior QC data
run: |
PROJECT_CONFIG="project_2samples"
PRIOR_QC_STATUS="no_priorQC"
USE_SLURM=""
python src/run_quac.py \
--project_name test_project \
--projects_path ".test/ngs-data/" \
--pedigree ".test/configs/${PRIOR_QC_STATUS}/${PROJECT_CONFIG}.ped" \
--outdir "data/quac/results/test_${PROJECT_CONFIG}_exome-${PRIOR_QC_STATUS}/analysis" \
--quac_watch_config "configs/quac_watch/exome_quac_watch_config.yaml" \
--workflow_config "configs/workflow.yaml" \
--exome \
$USE_SLURM \
|| df -h
- name: Run QuaC system testing - WGS mode AND uses prior QC data
run: |
PROJECT_CONFIG="project_2samples"
PRIOR_QC_STATUS="include_priorQC"
USE_SLURM=""
python src/run_quac.py \
--project_name test_project \
--projects_path ".test/ngs-data/" \
--pedigree ".test/configs/${PRIOR_QC_STATUS}/${PROJECT_CONFIG}.ped" \
--outdir "data/quac/results/test_${PROJECT_CONFIG}_wgs-${PRIOR_QC_STATUS}/analysis" \
--quac_watch_config "configs/quac_watch/wgs_quac_watch_config.yaml" \
--include_prior_qc \
--allow_sample_renaming \
--workflow_config "configs/workflow.yaml" \
$USE_SLURM \
|| df -h
- name: Run QuaC system testing - Exome mode AND uses prior QC data
run: |
PROJECT_CONFIG="project_2samples"
PRIOR_QC_STATUS="include_priorQC"
USE_SLURM=""
python src/run_quac.py \
--project_name test_project \
--projects_path ".test/ngs-data/" \
--pedigree ".test/configs/${PRIOR_QC_STATUS}/${PROJECT_CONFIG}.ped" \
--outdir "data/quac/results/test_${PROJECT_CONFIG}_exome-${PRIOR_QC_STATUS}/analysis" \
--quac_watch_config "configs/quac_watch/exome_quac_watch_config.yaml" \
--exome \
--include_prior_qc \
--allow_sample_renaming \
--workflow_config "configs/workflow.yaml" \
$USE_SLURM \
|| df -h
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Snakemake](https://img.shields.io/badge/snakemake-6.0.5-brightgreen.svg?style=flat)](https://snakemake.readthedocs.io)
[![ReadTheDocs](https://readthedocs.org/projects/quac/badge/?version=latest)](https://quac.readthedocs.io/en/stable/)
[![DOI](https://zenodo.org/badge/593702083.svg)](https://zenodo.org/badge/latestdoi/593702083)

[![system_testing](https://github.com/uab-cgds-worthey/quac/actions/workflows/system_testing.yml/badge.svg)](https://github.com/uab-cgds-worthey/quac/actions/workflows/system_testing.yml)

# QuaC

Expand Down
5 changes: 5 additions & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ YYYY-MM-DD John Doe
```
---

2023-05-31 Manavalan Gajapathy

* Adds system testing as github actions workflow


2023-05-18 Manavalan Gajapathy

* Constructs snakemake's `sbatch` command using args and values from cluster config file supplied via `--cluster_config`.
Expand Down

0 comments on commit 6eab6c9

Please sign in to comment.