sudo: required
language: python
jdk: openjdk8
services:
  - docker
python:
  - '3.6'
cache: pip
matrix:
  fast_finish: true

before_install:
  # PRs made to 'master' branch should always orginate from another repo or the 'dev' branch
  - '[ $TRAVIS_PULL_REQUEST = "false" ] || [ $TRAVIS_BRANCH != "master" ] || ([ $TRAVIS_PULL_REQUEST_SLUG = $TRAVIS_REPO_SLUG ] && [ $TRAVIS_PULL_REQUEST_BRANCH = "dev" ])'
  - docker pull nfcore/hlatyping
  - docker tag nfcore/hlatyping nfcore/hlatyping:1.1.2

install:
  # Install Nextflow
  - mkdir /tmp/nextflow
  - cd /tmp/nextflow
  - wget -qO- get.nextflow.io | bash
  - sudo ln -s /tmp/nextflow/nextflow /usr/local/bin/nextflow
  # Install nf-core/tools
  - pip install nf-core==1.3
  # Reset
  - cd ${TRAVIS_BUILD_DIR}

env:
  - NXF_VER=0.31.0 # Specify a minimum NF version that should be tested and work
  - NXF_VER='' # Plus: get the latest NF version and check, that it works

script:
  # Lint the pipeline code
  - nf-core lint ${TRAVIS_BUILD_DIR}
  # Run the pipeline with the test profile
  - nextflow run ${TRAVIS_BUILD_DIR} -profile test,docker
  - nextflow run ${TRAVIS_BUILD_DIR} -profile test_fastq,docker
