before_script:
  - module load astrocyte
  - module load python/3.6.1-2-anaconda
  - pip install --user pytest-pythonpath==0.7.1 pytest-cov==2.5.1
  - module load nextflow/19.09.0
  - module load singularity/3.0.2
  - mkdir -p test_data/simple1
  - mkdir -p test_data/simple2
  - ln -sfn /project/shared/bicf_workflow_ref/workflow_testdata/cellranger/cellranger_mkfastq/simple1/* test_data/simple1/
  - ln -sfn /project/shared/bicf_workflow_ref/workflow_testdata/cellranger/cellranger_mkfastq/simple2/* test_data/simple2/

stages:
  - astrocyte
  - simple

astrocyte_check:
  stage: astrocyte
  script:
    - astrocyte_cli check .
  artifacts:
    expire_in: 2 days
  retry:
    max: 0
    when:
      - always

simple_1FC:
  stage: simple
  script:
    - nextflow run workflow/main.nf --bcl "test_data/simple1/*.tar.gz" --designFile "test_data/simple1/cellranger-tiny-bcl-simple-1_2_0.csv"
    ##- pytest -m simple1
  artifacts:
    name: "$CI_JOB_NAME"
    when: always
    paths:
      - .nextflow.log
      - workflow/output/multiqc/run/multiqc_report.html
    expire_in: 2 days
  retry:
    max: 0
    when:
      - always

simple_2FC:
  stage: simple
  script:
    - nextflow run workflow/main.nf --bcl "test_data/simple2/*.tar.gz" --designFile "test_data/simple2/cellranger-tiny-bcl-simple-1_2_0.csv"
    ##- pytest -m simple2
  artifacts:
    name: "$CI_JOB_NAME"
    when: always
    paths:
      - .nextflow.log
      - workflow/output/multiqc/run/multiqc_report.html
    expire_in: 2 days
  retry:
    max: 0
    when:
      - always
