IAP GITLAB

.gitlab-ci.yml 4.7 KB
Newer Older
Ralf Ulrich's avatar
Ralf Ulrich committed
1 2
variables:
  GIT_SSL_NO_VERIFY: "1"
3 4 5 6 7 8
  ## Runtime options for sanitizers
  # (detect_leaks=0 because leak detection doesn't work in CI, but you can
  # try to test with leak detection locally by using detect_leaks=1)
  UBSAN_OPTIONS: "print_stacktrace=1"
  LSAN_OPTIONS: "log_threads=1"
  ASAN_OPTIONS: "detect_leaks=0:detect_stack_use_after_return=1"
Ralf Ulrich's avatar
Ralf Ulrich committed
9

Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
10 11 12
# normal multi-step pipeline for each commit
stages:
  - config
13
  - build_test
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
  - optional

# job/stage to just prepare cmake
config-u-18_04:
  image: corsika/devel:u-18.04
  stage: config
  tags:
    - corsika
  script:
    - mkdir build
    - cd build
    - cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_PYTHIA=ON
  artifacts:
    expire_in: 1 day
    paths:
       - build

# job/stage to just prepare cmake
config-clang-8:
  image: corsika/devel:clang-8
  stage: config
35 36 37 38 39
  tags:
    - corsika
  script:
    - mkdir build
    - cd build
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
40 41 42 43 44 45 46
    - cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_PYTHIA=ON
  artifacts:
    expire_in: 1 day
    paths:
       - build

# normal pipeline for each commit
Ralf Ulrich's avatar
Ralf Ulrich committed
47
build-test-u-18_04: 
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
48 49 50
  image: corsika/devel:u-18.04
  dependencies:
    - config-u-18_04
51
  stage: build_test
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
52 53 54 55
  tags:
    - corsika
  script:
    - cd build
56
    - cmake --build . -- -j4
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
57 58 59
    - set -o pipefail
    - ctest -VV | gzip -v -9 > test.log.gz 
  artifacts:
60 61 62 63
#    expire_in: 1 day
#    paths:
#       - build
    expire_in: 1 week
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
64 65 66
    reports:
      junit:
        - build/test_outputs/junit*.xml
67 68
    paths:
      - build/test.log.gz
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
69

70
# normal pipeline for each commit
Ralf Ulrich's avatar
Ralf Ulrich committed
71
build-test-clang-8: 
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
72 73
  image: corsika/devel:clang-8
  dependencies:
74 75
    - config-clang-8
  stage: build_test
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
76 77 78 79
  tags:
    - corsika
  script:
    - cd build
80 81
    - cmake --build . -- -j4
    - set -o pipefail
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
82 83
    - ctest -VV | gzip -v -9 > test.log.gz 
  artifacts:
84 85 86 87
#    expire_in: 1 day
#    paths:
#       - build
    expire_in: 1 week
88 89 90
    reports:
      junit:
        - build/test_outputs/junit*.xml
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
91 92
    paths:
      - build/test.log.gz
93

94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
# test-u-18_04: 
#   image: corsika/devel:u-18.04
#   dependencies:
#     - build-u-18_04
#   stage: test
#   tags:
#     - corsika
#   script:
#     - cd build
#     - set -o pipefail
#     - ctest -VV | gzip -v -9 > test.log.gz 
#   artifacts:
#     expire_in: 1 week
#     reports:
#       junit:
#         - build/test_outputs/junit*.xml
#     paths:
#       - build/test.log.gz

# test-clang-8: 
#   image: corsika/devel:clang-8
#   dependencies:
#     - build-clang-8
#   stage: test
#   tags:
#     - corsika
#   script:
#     - cd build
#     - set -o pipefail
#     - ctest -VV | gzip -v -9 > test.log.gz 
#   artifacts:
#     expire_in: 1 week
#     reports:
#       junit:
#         - build/test_outputs/junit*.xml
#     paths:
#       - build/test.log.gz

Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
132 133 134 135 136 137
# normal pipeline for each commit
release-u-18_04: 
  image: corsika/devel:u-18.04
  dependencies:
    - config-u-18_04
  stage: optional
138 139 140
  tags:
    - corsika
  script:
141
    - cd build
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
142
    - cmake .. -DCMAKE_BUILD_TYPE=Release
143
    - cmake --build . -- -j4
144
    - ctest -j4 
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
  when: manual    

# normal pipeline for each commit
release-clang-8: 
  image: corsika/devel:clang-8
  dependencies:
    - config-clang-8
  stage: optional
  tags:
    - corsika
  script:
    - cd build
    - cmake .. -DCMAKE_BUILD_TYPE=Release
    - cmake --build . -- -j4
    - ctest -j4 
  when: manual    

Ralf Ulrich's avatar
Ralf Ulrich committed
162 163
# the coverage generation should either run when manually requested, OR for all changes on the master
.coverage_job: &coverage_job
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
164 165 166 167 168 169 170 171 172 173 174 175 176
  image: corsika/devel:u-18.04
  dependencies:
    - config-u-18_04
  stage: optional
  tags:
    - corsika
  script:
    - cd build
    - cmake .. -DCMAKE_BUILD_TYPE=Coverage
    - cmake --build . -- -j4
    - ctest -j4 -V > test.log 
    - cmake --build . --target coverage
    - tar czf coverage-report.tar.gz coverage-report
Ralf Ulrich's avatar
Ralf Ulrich committed
177
  coverage: '/^.*functions\.+:\s(.*\%)\s/'
178
  artifacts:
179
    expire_in: 1 year
180
    paths:
181
      - build/coverage-report.tar.gz
Ralf Ulrich's avatar
Ralf Ulrich committed
182

Ralf Ulrich's avatar
Ralf Ulrich committed
183
coverage: # special manual job to run after normal pipeline on branch finished 
Ralf Ulrich's avatar
Ralf Ulrich committed
184
  <<: *coverage_job
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
185
  when: manual    
Ralf Ulrich's avatar
Ralf Ulrich committed
186 187 188
  except:
    refs:
      - master
Ralf Ulrich's avatar
Ralf Ulrich committed
189 190 191 192 193 194

coverage_master: # special job to run on master banch changes
  <<: *coverage_job
  only:
    refs:
      - master
Ralf Ulrich's avatar
Ralf Ulrich committed
195

Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
196 197 198
documentation:
  image: corsika/devel:u-18.04
  dependencies:
199
    - config-u-18_04
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
200
  stage: optional
Ralf Ulrich's avatar
Ralf Ulrich committed
201
  tags:
Lukas Nellen's avatar
Lukas Nellen committed
202
    - corsika
203
  script:
Ralf Ulrich's avatar
Ralf Ulrich committed
204
    - cd build
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
205
    - cmake --build . --target doxygen -- -j4
206 207
    - mkdir .public
    - cp -r Documentation/Doxygen/html .public/
Ralf Ulrich's avatar
Ralf Ulrich committed
208
    - mv .public ../public
209
  artifacts:
210
    expire_in: 3 weeks
211 212
    paths:
      - public
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
  when: manual
  allow_failure: true

sanity:
  image: corsika/devel:u-18.04
  dependencies:
    - config-u-18_04
  stage: optional
  tags:
    - corsika
  script:
    - cd build
    - cmake .. -DWITH_CORSIKA_SANITIZERS_ENABLED=ON
    - cmake --build . -- -j4
  when: manual
  allow_failure: true