image: eicweb.phy.anl.gov:4567/eic/juggler/juggler:$JUGGLER_TAG

default:
  before_script:
    - source .local/bin/env.sh
  artifacts:
    expire_in: 3 days
    paths:
      - .local/detector
      - .local/lib
      - .local/bin
      - .local/include
      - .local/share
      - results
      - config
      - juggler.env
    reports:
      dotenv: juggler.env

stages:
  - config
  - initialize
  - generate
  - process
  - collect
  - finish

common:setup:
  stage: config
  before_script:
    - git clone https://eicweb.phy.anl.gov/EIC/benchmarks/common_bench.git setup 
  script:
    - source setup/bin/env.sh && ./setup/bin/install_common.sh

common:detector:
  stage: initialize
  needs: ["common:setup"]
  script:
    - source .local/bin/env.sh && build_detector.sh
    - mkdir_local_data_link sim_output
    - mkdir -p results
    - mkdir -p config
    - print_env.sh

include:
  #- local: 'benchmarks/dis/config.yml'
  #- local: 'benchmarks/dvmp/config.yml'
  - local: 'benchmarks/dvcs/config.yml'

summary:
  stage: finish
  #needs: ["dis:results", "dvcs:results", "dvmp:results"]
  needs:
    - "dvcs:results"
  script:
    - collect_benchmarks.py
  artifacts:
    paths:
      - results/*
#    reports:
#      junit: ["results/dvcs/report2.xml"]