.gitlab-ci.yml 3.43 KB
Newer Older
Whitney Armstrong's avatar
Whitney Armstrong committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
image: eicweb.phy.anl.gov:4567/eic/juggler/juggler:latest

workflow:
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
    - if: '$CI_PIPELINE_SOURCE == "web"'
    - if: '$CI_PIPELINE_SOURCE == "webide"'
    - if: '$CI_COMMIT_BRANCH == "master"'
    - if: '$CI_COMMIT_TAG'

default:
  before_script:
    - mkdir -p images && mkdir -p doc/
    - git clone https://eicweb.phy.anl.gov/EIC/detectors/accelerator.git && ln -s accelerator/eic 
15
    - git clone https://eicweb.phy.anl.gov/EIC/detectors/ip6.git  eic_ip6 && mkdir ip6_build && cd ip6_build && cmake ../eic_ip6/. -DCMAKE_INSTALL_PREFIX=/usr/local && make -j20 && make install  && cd .. && ln -s eic_ip6/ip6 
Whitney Armstrong's avatar
Whitney Armstrong committed
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
    - mkdir build && cd build && cmake ../. -DCMAKE_INSTALL_PREFIX=/usr/local && make -j20 && make install  && cd ..
  artifacts:
    paths:
      - images/
      - doc/
    reports:
      dotenv: juggler.env

stages:
  - config
  - build
  - docs
  - test 
  - finalize 
  - deploy

env:
  stage: config 
  script:
Jihee Kim's avatar
Jihee Kim committed
35
    - export JUGGLER_DETECTOR="reference_detector"
Whitney Armstrong's avatar
Whitney Armstrong committed
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
    - |
      if [[ "x${CI_PIPELINE_SOURCE}" == "xmerge_request_event"  || "$CI_COMMIT_BRANCH" == "master" ]]; then
        export JUGGLER_DETECTOR_VERSION="${CI_COMMIT_REF_NAME}"
        echo "JUGGLER_DETECTOR         = ${JUGGLER_DETECTOR}"
        echo "JUGGLER_DETECTOR_VERSION = ${CI_COMMIT_REF_NAME}"
        echo "JUGGLER_DETECTOR_VERSION=$CI_COMMIT_REF_NAME" >> juggler.env
        echo "JUGGLER_DETECTOR=$JUGGLER_DETECTOR" >> juggler.env
      fi
  artifacts:
    reports:
      dotenv: juggler.env


compile:
  stage: build
  needs:
    - ["env"]
  script:
Whitney Armstrong's avatar
Whitney Armstrong committed
54
    - mkdir -p build && cd build && cmake ../. -DCMAKE_INSTALL_PREFIX=/usr/local && make -j20 && make install  && cd ..
Whitney Armstrong's avatar
Whitney Armstrong committed
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
    - echo "Build successful."

.views:
  stage: docs
  needs:
    - ["compile"]
  artifacts:
    paths:
      - images/
      - doc/

include:
  - local: 'views/view1.yml'
  - local: 'views/view2.yml'
  - local: 'views/view3.yml'
  - local: 'views/view6.yml'
  - local: 'views/view7.yml'
  - local: 'views/config.yml'

report:
  stage: finalize
  needs: 
    - view_01
    - dawn_view_02:detector
    - dawn_view_03:detector
  artifacts:
    paths:
      - images/
      - doc/
  script:
    - pip3 install jinja2 &&  ls -lrth
    - ./bin/make_images > doc/dawn_views.md


overlap_check:
  stage: test
  needs: 
    - ["compile"]
  script:
Jihee Kim's avatar
Jihee Kim committed
94
    - checkOverlaps -c reference_detector.xml  | tee doc/overlap_check.out 
Whitney Armstrong's avatar
Whitney Armstrong committed
95
96
97
    - echo "$(cat doc/overlap_check.out | grep ovlp | wc -l) overlaps..."
    - if [[ "$(cat doc/overlap_check.out | grep ovlp | wc -l)" -gt "1" ]] ; then echo "Overlaps exist!" && false ; fi

98
detector:config_testing:
Whitney Armstrong's avatar
Whitney Armstrong committed
99
100
101
102
  stage: test
  needs: 
    - ["compile"]
  script:
Jihee Kim's avatar
Jihee Kim committed
103
    - checkOverlaps -c reference_detector.xml  | tee doc/overlap_check.out | wc -l
Whitney Armstrong's avatar
Whitney Armstrong committed
104
105
106
    - cat doc/overlap_check.out
  allow_failure: true

Whitney Armstrong's avatar
Whitney Armstrong committed
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
    #benchmarks:reconstruction:
    #  stage: deploy
    #  variables:
    #    JUGGLER_DETECTOR: "$JUGGLER_DETECTOR"
    #    JUGGLER_DETECTOR_VERSION: "$JUGGLER_DETECTOR_VERSION"
    #  trigger:
    #    project: EIC/benchmarks/reconstruction_benchmarks
    #    strategy: depend
    #  needs: ["env","overlap_check","report"]
    #  
    #
    #benchmarks:physics:
    #  stage: deploy
    #  variables:
    #    JUGGLER_DETECTOR: "$JUGGLER_DETECTOR"
    #    JUGGLER_DETECTOR_VERSION: "$JUGGLER_DETECTOR_VERSION"
    #  trigger:
    #    project: EIC/benchmarks/physics_benchmarks
    #    strategy: depend
    #  needs: ["env","overlap_check","report"]
Whitney Armstrong's avatar
Whitney Armstrong committed
127