before_script:
  - module add  python/3.6.1-2-anaconda
  - pip install --user pytest-pythonpath==0.7.1 pytest-cov==2.5.1
  - module load  nextflow/0.31.0
  - ln -s /project/shared/bicf_workflow_ref/workflow_testdata/chipseq/*fastq.gz test_data/

stages:
  - unit
  - skip
  - single
  - multiple

user_configuration:
  stage: unit
  script:
  - pytest -m unit
  - pytest -m unit --cov=./workflow/scripts

single_end_mouse:
  stage: single
  only:
    - master
  except:
    - branches
  script:
  - nextflow run workflow/main.nf -resume
  - pytest -m singleend
  artifacts:
    expire_in: 2 days

paired_end_human:
  stage: single
  only:
    - branches
  except:
    - master
  script:
  - nextflow run workflow/main.nf --designFile "$CI_PROJECT_DIR/test_data/design_ENCSR729LGA_PE.txt" --genome 'GRCh38' --pairedEnd true -resume
  - pytest -m pairedend
  artifacts:
    expire_in: 2 days

single_end_diff:
  stage: multiple
  only:
    - branches
  except:
    - master
  script:
  - nextflow run workflow/main.nf --designFile "$CI_PROJECT_DIR/test_data/design_diff_SE.txt" --genome 'GRCm38' -resume
  - pytest -m singlediff singlediff_true
  artifacts:
    expire_in: 2 days

paired_end_diff:
  only:
    - master
  except:
    - branches
  stage: multiple
  script:
  - nextflow run workflow/main.nf --designFile "$CI_PROJECT_DIR/test_data/design_diff_PE.txt" --genome 'GRCh38' --pairedEnd true -resume
  - pytest -m paireddiff
  artifacts:
    expire_in: 2 days

single_end_skip:
  stage: skip
  only:
    - branches
  except:
    - master
  script:
  - nextflow run workflow/main.nf --designFile "$CI_PROJECT_DIR/test_data/design_diff_SE.txt" --genome 'GRCm38' --skipDiff true --skipMotif true -resume
  - pytest -m singlediff singleskip_true
  artifacts:
    expire_in: 2 days
