diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml new file mode 100644 index 0000000000..05b94b0daa --- /dev/null +++ b/.github/workflows/branch.yml @@ -0,0 +1,14 @@ +name: nf-core branch protection +# This workflow is triggered on PRs to master branch on the repository +on: + pull_request: + branches: + - master + +jobs: + test: + runs-on: ubuntu-latest + steps: + # PRs are only ok if coming from an nf-core dev branch + - name: Check PRs + run: [ ${GITHUB_ACTOR} = "nf-core" ] && [ ${GITHUB_HEAD_REF} = "dev" ] \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..a42622b711 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,27 @@ +name: nf-core CI +# This workflow is triggered on pushes and PRs to the repository. +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + test: [ANNOTATESNPEFF, ANNOTATEVEP, GERMLINE, SOMATIC, TARGETED] + nxf_ver: ['19.04.0', ''] + steps: + - uses: actions/checkout@v1 + - name: Install Nextflow + run: | + export NXF_VER=${{ matrix.nxf_ver }} + wget -qO- get.nextflow.io | bash + sudo mv nextflow /usr/local/bin/ + - name: Download image + run: | + ${GITHUB_WORKSPACE}/scripts/download_image.sh -n docker --test ${{ matrix.test }} + - name: Build References + run: | + ${GITHUB_WORKSPACE}/scripts/build_reference.sh --test ${{ matrix.test }} --verbose --memory 6.GB + - name: Run test + run: | + ${GITHUB_WORKSPACE}/scripts/run_tests.sh --test ${{ matrix.test }} --verbose --memory 6.GB \ No newline at end of file diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml new file mode 100644 index 0000000000..0bb9aadd17 --- /dev/null +++ b/.github/workflows/linting.yml @@ -0,0 +1,18 @@ +name: nf-core linting +# This workflow is triggered on pushes and PRs to the repository. +on: [push, pull_request] + +jobs: + Markdown: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: '10' + - name: Install markdownlint + run: | + npm install -g markdownlint-cli + - name: Run Markdownlint + run: | + markdownlint ${GITHUB_WORKSPACE} -c ${GITHUB_WORKSPACE}/.github/markdownlint.yml \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index cbb65a0da6..7fb126f18c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,6 +58,6 @@ jobs: include: - stage: "Linting" name: "Markdown" - env: TEST=GERMLINE NXF_VER=19.04.0 + env: TEST=LINT NXF_VER=19.04.0 script: - markdownlint ${TRAVIS_BUILD_DIR} -c ${TRAVIS_BUILD_DIR}/.github/markdownlint.yml \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 22993ea81c..66339a7ce8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ Initial release of `nf-core/sarek`, created with the [nf-core](http://nf-co.re/) - [#20](https://github.com/nf-core/sarek/pull/20) - Add `markdownlint` config file - [#21](https://github.com/nf-core/sarek/pull/21) - Add tests for latest Nextflow version as well - [#21](https://github.com/nf-core/sarek/pull/21) - Add `genomes.config` for genomes without AWS iGenomes +- [#XXX](https://github.com/nf-core/sarek/pull/XXX) - Use Github actions for CI ### `Changed` diff --git a/README.md b/README.md index 058a01b5ba..dd52d8cea4 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ [![nf-core][nf-core-badge]](https://nf-co.re/) [![Travis build status][travis-badge]](https://travis-ci.com/nf-core/sarek/) +[![GitHub Actions CI Status](https://github.com/nf-core/sarek/workflows/nf-core%20CI/badge.svg)](https://github.com/nf-core/sarek/actions) +[![GitHub Actions Linting Status](https://github.com/nf-core/sarek/workflows/nf-core%20linting/badge.svg)](https://github.com/nf-core/sarek/actions) [![CircleCi build status][circleci-badge]](https://circleci.com/gh/nf-core/sarek/) [![Install with bioconda][bioconda-badge]](https://bioconda.github.io/) diff --git a/scripts/build_reference.sh b/scripts/build_reference.sh index 2e34a04d0d..636b161628 100755 --- a/scripts/build_reference.sh +++ b/scripts/build_reference.sh @@ -4,14 +4,15 @@ set -xeuo pipefail # This script build small reference for sarek tests # https://github.com/nf-core/test-datasets/raw/sarek -usage() { echo "Usage: $0 <-p profile> <-t test> <-v>" 1>&2; exit 1; } +usage() { echo "Usage: $0 <-p profile> <-t test> <-v> <-m memory>" 1>&2; exit 1; } +MEMORY='7.GB' NXF_SINGULARITY_CACHEDIR=${NXF_SINGULARITY_CACHEDIR:-work/singularity/.} OFFLINE='' PROFILE=docker TEST=ALL -TRAVIS_BUILD_DIR=${TRAVIS_BUILD_DIR:-.} TRAVIS=${TRAVIS:-false} +TRAVIS_BUILD_DIR=${TRAVIS_BUILD_DIR:-.} VERBOSE='' while [[ $# -gt 0 ]] @@ -23,6 +24,11 @@ do shift # past argument shift # past value ;; + -m|--memory) + MEMORY=$2 + shift # past argument + shift # past value + ;; --offline) OFFLINE="--offline" shift # past value @@ -44,9 +50,9 @@ do done # Build references for smallGRCh37 -if ! [[ ANNOTATESNPEFF,ANNOTATEVEP =~ $TEST ]] +if ! [[ ANNOTATEBOTH,ANNOTATESNPEFF,ANNOTATEVEP,LINT =~ $TEST ]] then rm -rf references - nextflow run ${TRAVIS_BUILD_DIR}/build.nf -profile test,${PROFILE} --build --outdir references ${VERBOSE} ${OFFLINE} + nextflow run ${TRAVIS_BUILD_DIR}/build.nf -profile test,${PROFILE} --build --outdir references ${VERBOSE} ${OFFLINE} --max_memory ${MEMORY} rm -rf .nextflow* references/pipeline_info work fi diff --git a/scripts/download_image.sh b/scripts/download_image.sh index 862f265033..959e8fb843 100755 --- a/scripts/download_image.sh +++ b/scripts/download_image.sh @@ -74,7 +74,7 @@ then get_image sarekvep ${VERSION}.${SOURCEGENOME} ${VERSION}.${GENOME} fi -if ! [[ ANNOTATEBOTH,ANNOTATESNPEFF,ANNOTATEVEP,SNPEFF,VEP =~ $TEST ]] +if ! [[ ANNOTATEBOTH,ANNOTATESNPEFF,ANNOTATEVEP,LINT,SNPEFF,VEP =~ $TEST ]] then get_image sarek ${VERSION} ${VERSION} fi diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index 2e947e8a24..2842d9b7f4 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -4,14 +4,15 @@ set -xeuo pipefail # This script run sarek tests # https://github.com/nf-core/test-datasets/raw/sarek -usage() { echo "Usage: $0 <-p profile> <-t test> <-c cpus> <-n> <-v>" 1>&2; exit 1; } +usage() { echo "Usage: $0 <-p profile> <-t test> <-c cpus> <-n> <-v> <-m memory>" 1>&2; exit 1; } CPUS=2 LOGS='' -REPORTS='' +MEMORY='7.GB' NXF_SINGULARITY_CACHEDIR=${NXF_SINGULARITY_CACHEDIR:-work/singularity/.} OFFLINE=false PROFILE=docker +REPORTS='' TEST=MULTIPLE TRAVIS=${TRAVIS:-false} TRAVIS_BUILD_DIR=${TRAVIS_BUILD_DIR:-.} @@ -25,6 +26,11 @@ do CPUS=$2 shift # past value ;; + -m|--memory) + MEMORY=$2 + shift # past argument + shift # past value + ;; -n|--no-logs) LOGS=true shift # past value @@ -66,7 +72,7 @@ function manage_logs() { } function run_sarek() { - nextflow run ${TRAVIS_BUILD_DIR}/main.nf -profile test,${PROFILE} ${VERBOSE} --monochrome_logs ${REPORTS} $@ + nextflow run ${TRAVIS_BUILD_DIR}/main.nf -profile test,${PROFILE} ${VERBOSE} --monochrome_logs ${REPORTS} --max_memory ${MEMORY} $@ } if [[ $OFFLINE == false ]]