Skip to content

Commit

Permalink
Convert pipeline to DSL2
Browse files Browse the repository at this point in the history
  • Loading branch information
emi80 committed Nov 25, 2021
1 parent af3d3e8 commit 8f04510
Show file tree
Hide file tree
Showing 12 changed files with 832 additions and 703 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set -o pipefail
DB_FILE=chipseq-pipeline.db
VALIDATE_DIR=validate-ci

export NXF_ANSI_LOG=false
export NXF_DOCKER=${NXF_DOCKER-'with'}
getPath() {
if [ -n "$(type -a realpath)" ]; then
realpath $@
Expand All @@ -17,16 +19,27 @@ case "$1" in
run)
shift
echo "Running test pipeline..." >&2
./nextflow run . $@
./nextflow run . -${NXF_DOCKER}-docker $@
;;
validate)
shift
f=$(getPath ${1-data/md5s})
md5s=$(getPath ${1-data/md5s})
echo "Validating test results..." >&2
[[ -s ${DB_FILE} ]] || false
mkdir -p ${VALIDATE_DIR} && cd ${VALIDATE_DIR}
cut -f 2 ../${DB_FILE} | xargs -I{} ln -fs {}
md5sum -c ${f}
cut -f 2 ../${DB_FILE} | while read f
do
name=$(basename $f)
ext=${name##*.}
case $ext in
bam)
samtools view ${f} > ${name%.*}.sam
;;
*)
ln -fs ${f} .
esac
done
md5sum -c ${md5s}
;;
cleanup)
echo "Cleaning up test results..." >&2
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ jobs:
curl -fsSL get.nextflow.io | bash -e
- name: Run pipeline
run: |
.github/workflows/ci.sh run -with-docker
.github/workflows/ci.sh run
- name: Validate pipeline results
run: |
.github/workflows/ci.sh validate
uses: addnab/docker-run-action@v3
with:
image: guigolab/chip-nf:dev
options: -v ${{ github.workspace }}:${{ github.workspace }} -w ${{ github.workspace }}
run: |
.github/workflows/ci.sh validate
Loading

0 comments on commit 8f04510

Please sign in to comment.