Skip to content

Commit

Permalink
15 cicd tests (#24)
Browse files Browse the repository at this point in the history
* Create main.yml

* files added

* singularity removed and args cleaned

* fix
  • Loading branch information
kubranarci committed Jan 23, 2024
1 parent f7f8a40 commit 68acc55
Show file tree
Hide file tree
Showing 34 changed files with 290 additions and 54 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Bug report
description: Report something that is broken or incorrect
labels: bug
body:
- type: checkboxes
attributes:
label: Have you checked the docs?
description: I have checked the following places for my error
options:
- label: "[nf-core website: troubleshooting](https://nf-co.re/usage/troubleshooting)"
required: true
- label: "[nf-core modules documentation](https://nf-co.re/docs/contributing/modules)"
required: true

- type: textarea
id: description
attributes:
label: Description of the bug
description: A clear and concise description of what the bug is.
validations:
required: true

- type: textarea
id: command_used
attributes:
label: Command used and terminal output
description: Steps to reproduce the behaviour. Please paste the command you used to launch the pipeline and the output from your terminal.
render: console
placeholder: |
$ nextflow run ...
Some output where something broke
- type: textarea
id: files
attributes:
label: Relevant files
description: |
Please drag and drop the relevant files here. Create a `.zip` archive if the extension is not allowed.
Your verbose log file `.nextflow.log` is often useful _(this is a hidden file in the directory where you launched the pipeline)_ as well as custom Nextflow configuration files.
- type: textarea
id: system
attributes:
label: System information
description: |
* Nextflow version _(eg. 21.10.3)_
* Hardware _(eg. HPC, Desktop, Cloud)_
* Executor _(eg. slurm, local, awsbatch)_
* Container engine and version: _(e.g. Docker, Singularity)_
* OS and version: _(eg. CentOS Linux, macOS, Ubuntu 22.04)_
* Image tag: <!-- [e.g. biocontainers/platypus-variant:0.8.1.2] -->
32 changes: 32 additions & 0 deletions .github/workflows/ISSUE_TEMPLATE/feature_reuest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Feature request
description: Suggest an idea
labels: feature
title: "[FEATURE]"
body:
- type: textarea
id: description
attributes:
label: Is your feature request related to a problem? Please describe
description: A clear and concise description of what the bug is.
placeholder: |
<!-- e.g. [I'm always frustrated when ...] -->
validations:
required: true

- type: textarea
id: solution
attributes:
label: Describe the solution you'd like
description: A clear and concise description of the solution you want to happen.

- type: textarea
id: alternatives
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've considered.

- type: textarea
id: additional_context
attributes:
label: Additional context
description: Add any other context about the feature request here.
44 changes: 44 additions & 0 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: branch protection
# This workflow is triggered on PRs to master branch on the repository
# It fails when someone tries to make a PR against the `master` branch instead of `dev`
on:
pull_request_target:
branches: [master]

jobs:
test:
runs-on: ubuntu-latest
steps:
# PRs to the master branch are only ok if coming from the repo `dev` or any `patch` branches
- name: Check PRs
if: github.repository == 'ghga-de/nf-aceseq'
run: |
{ [[ ${{github.event.pull_request.head.repo.full_name }} == ghga-de/nf-aceseq ]] && [[ $GITHUB_HEAD_REF = "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]]
# If the above check failed, post a comment on the PR explaining the failure
# NOTE - this doesn't currently work if the PR is coming from a fork, due to limitations in GitHub actions secrets
- name: Post PR comment
if: failure()
uses: mshick/add-pr-comment@v1
with:
message: |
## This PR is against the `master` branch :x:
* Do not close this PR
* Click _Edit_ and change the `base` to `dev`
* This CI test will remain failed until you push a new commit
---
Hi @${{ github.event.pull_request.user.login }},
It looks like this pull-request is has been made against the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `master` branch.
The `master` branch on nf-core repositories should always contain code from the latest release.
Because of this, PRs to `master` are only allowed if they come from the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `dev` branch.
You do not need to close this PR, you can change the target branch to `dev` by clicking the _"Edit"_ button at the top of this page.
Note that even after this, the test will continue to show as failing until you push a new commit.
Thanks again for your contribution!
repo-token: ${{ secrets.GITHUB_TOKEN }}
allow-repeats: false
47 changes: 47 additions & 0 deletions .github/workflows/code_linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Code Linting
on:
push:
branches:
- master
- dev
release:
types: [published]
pull_request:
branches: [master]
merge_group:
types: [checks_requested]
branches: [master]

# Cancel if a newer run is started
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
Prettier:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Install NodeJS
uses: actions/setup-node@v2

- name: Install Prettier
run: npm install -g prettier

- name: Run Prettier --check
run: prettier --check .

EditorConfig:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v2

- name: Install editorconfig-checker
run: npm install -g editorconfig-checker

- name: Run ECLint check
run: editorconfig-checker -exclude README.md $(git ls-files | grep -v test)
44 changes: 44 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Main
# This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors
on:
push:
branches:
- dev
- 15-cicd-tests
pull_request:
release:
types: [published]

# Uncomment if we need an edge release of Nextflow again
# env: NXF_EDGE: 1

jobs:
test:
name: Run workflow tests
runs-on: ubuntu-latest
env:
NXF_VER: ${{ matrix.nxf_ver }}
NXF_ANSI_LOG: false
strategy:
matrix:
# Nextflow versions: check pipeline minimum and current latest
nxf_ver: ["22.10.6"]
steps:
- name: Check out pipeline code
uses: actions/checkout@v3

- name: Install Nextflow
env:
CAPSULE_LOG: none
run: |
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/
- name: HELPTEXT Run with the help flag
run: |
nextflow run ${GITHUB_WORKSPACE} --help
- name: DELAY to try address some odd behaviour with what appears to be a conflict between parallel htslib jobs leading to CI hangs
run: |
if [[ $NXF_VER = '' ]]; then sleep 1200; fi
- name: BASIC Run the basic pipeline only for ACE calling with docker
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test,docker
74 changes: 56 additions & 18 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ process {
]
}
withName: 'ADD_HAPLOTYPES' {
ext.args = ""
publishDir = [
path: {"${params.outdir}/${meta.id}/phasing"},
pattern: "*{.tab.gz,.tab.gz.tbi}",
Expand All @@ -68,101 +67,140 @@ process {
}

withName: 'ADD_CREST|ADD_SVS' {
ext.args = ""
publishDir = [
path: {"${params.outdir}/${meta.id}"},
pattern: "*{.txt}",
mode: params.publish_dir_mode
]
}
withName: GROUP_HAPLOTYPES {
ext.args = ""
publishDir = [
path: {"${params.outdir}/${meta.id}/haploblocks"},
pattern: "*{.tab}",
mode: params.publish_dir_mode
]
}
withName: DEFINE_BREAKPOINTS {
ext.args = ""
ext.args = '--libloc "" '
publishDir = [
path: {"${params.outdir}/${meta.id}"},
pattern: "*{.txt.gz,.txt.gz.tbi,.pdf,.txt}",
mode: params.publish_dir_mode
]
}
withName: CLUSTER_SEGMENTS {
ext.args = ""
ext.args = '--out . --libloc "" --runInDebugMode false'
publishDir = [
path: {"${params.outdir}/${meta.id}"},
pattern: "*{.txt.gz,.txt.gz.tbi,.txt,.pdf}",
mode: params.publish_dir_mode
]
}
withName: "HOMOZYGOUS_DELETIONS|SEGMENTS_TO_DATA" {
ext.args = ""
publishDir = [
path: {"${params.outdir}/${meta.id}"},
pattern: "*{.txt.gz,.txt.gz.tbi}",
mode: params.publish_dir_mode
]
}
withName: 'GC_BIAS|CONVERT_TO_JSON' {
ext.args = ""
publishDir = [
path: {"${params.outdir}/${meta.id}/gc_bias"},
pattern: "*{png,txt,tsv,json,tab.gz,txt.gz}",
mode: params.publish_dir_mode
]
}
withName: 'CREATE_BAF_PLOTS' {
ext.args = ""
ext.args = "--plot_Dir ."
publishDir = [
path: {"${params.outdir}/${meta.id}/baf_plots"},
pattern: "*{png}",
mode: params.publish_dir_mode
]
}
withName: GENERATE_PLOTS {
ext.args = ""
ext.args = "--outDir ."
publishDir = [
path: {"${params.outdir}/${meta.id}/plots"},
pattern: "*{.png}",
pattern: "*{png,txt}",
mode: params.publish_dir_mode
]
}
withName: 'PURITY_PLOIDY' {
ext.args = ""
ext.args = "--path ."
publishDir = [
path: {"${params.outdir}/${meta.id}"},
pattern: "*{.json}",
mode: params.publish_dir_mode
]
}
withName: GENERATE_PLOTS {
ext.args = ""
withName: 'ESTIMATE_PEAKS' {
ext.args = "--out ."
publishDir = [
path: {"${params.outdir}/${meta.id}"},
pattern: "*{.txt}",
mode: params.publish_dir_mode
]
}
withName: 'ESTIMATE_PURITY_PLOIDY' {
ext.args = "--out ."
publishDir = [
path: {"${params.outdir}/${meta.id}"},
pattern: "*{.txt}",
mode: params.publish_dir_mode
]
}
withName: 'PSCBS_SEGMENTATION' {
ext.args = '--libloc "" '
publishDir = [
path: {"${params.outdir}/${meta.id}"},
pattern: "*{.txt}",
mode: params.publish_dir_mode
]
}
withName: 'ESTIMATE_HDRSCORE' {
publishDir = [
path: {"${params.outdir}/${meta.id}"},
pattern: "*{.txt}",
mode: params.publish_dir_mode
]
}
withName: "ESTIMATE_PEAKS|ESTIMATE_PURITY_PLOIDY|PSCBS_SEGMENTATION|ESTIMATE_HDRSCORE|ESTIMATE_SEX" {
ext.args = ""
withName: "ESTIMATE_SEX" {
publishDir = [
path: {"${params.outdir}/${meta.id}"},
pattern: "*{.txt}",
mode: params.publish_dir_mode
]
}
withName: 'MERGE_SNP|MERGE_CNV|GET_GENOTYPES' {
ext.args = ""
withName: 'MERGE_CNV' {
ext.args = "--inputsuffix '.cnv.anno.tab.gz'"
publishDir = [
path: {"${params.outdir}/${meta.id}"},
pattern: "*{tab.gz,tab.gz.tbi}",
mode: params.publish_dir_mode
]
}
withName: 'MERGE_SNP' {
publishDir = [
path: {"${params.outdir}/${meta.id}"},
pattern: "*{tab.gz,tab.gz.tbi}",
mode: params.publish_dir_mode
]
}
withName: 'GET_GENOTYPES' {
publishDir = [
path: {"${params.outdir}/${meta.id}"},
pattern: "*{tab.gz,tab.gz.tbi}",
mode: params.publish_dir_mode
]
}
withName: 'BEAGLE5_BEAGLE' {
publishDir = [
path: {"${params.outdir}/${meta.id}"},
pattern: "*{noting}",
mode: params.publish_dir_mode
]
}
withName: CUSTOM_DUMPSOFTWAREVERSIONS {
publishDir = [
path: { "${params.outdir}/pipeline_info" },
Expand All @@ -176,7 +214,7 @@ process {
// Don't publish results for these processes
//
process {
withName: 'GREP_GENOTYPES|GETCHROMSIZES|EMBED_HAPLOTYPES|BEAGLE5_BEAGLE|CREATE_UNPHASED|FAKE_CONTROL|GET_GENOTYPES|MAKE_MOCK|WIN_GENERATOR|CREATE_FAKE_SAMPLES|PREPARE_BEAGLE_REF' {
withName: 'GETCHROMSIZES|EMBED_HAPLOTYPES|CREATE_UNPHASED|FAKE_CONTROL|MAKE_MOCK|WIN_GENERATOR|CREATE_FAKE_SAMPLES|PREPARE_BEAGLE_REF' {
publishDir = [
path: { "${params.outdir}/test" },
enabled: false
Expand Down
Loading

0 comments on commit 68acc55

Please sign in to comment.