IAP GITLAB

.gitlab-ci.yml 13.6 KB
Newer Older
Ralf Ulrich's avatar
Ralf Ulrich committed
1
variables:
2
  GIT_STRATEGY: fetch
Ralf Ulrich's avatar
Ralf Ulrich committed
3
  GIT_SSL_NO_VERIFY: "1"
4
  GIT_DEPTH: "1"
5 6
  # to re-use clones also in different forks
  GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_CONCURRENT_ID/$CI_PROJECT_NAME
7 8 9 10 11 12
  ## 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"
13
  # location of AirShowerPhysics/corsika-data
14
  CORSIKA_DATA: "${CI_PROJECT_DIR}/Data" # the git submodule
15 16 17 18 19 20 21
  # _alternatively_ corsika-data can be downloaded as submodule:
  GIT_SUBMODULE_STRATEGY: normal


#
# multi-step pipeline for each commit
#
Ralf Ulrich's avatar
Ralf Ulrich committed
22
# Mote: "Draft:" merge request, non-Draft merge requests and "Ready for Code Review" MR are all
23 24
#       handled explicitly
#
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
25
stages:
Ralf M Ulrich's avatar
quality  
Ralf M Ulrich committed
26
  - quality
27
  - config
Ralf M Ulrich's avatar
Ralf M Ulrich committed
28 29
  - build
  - test
30
  - build_test
Ralf M Ulrich's avatar
Ralf M Ulrich committed
31
  - example
32
  - build_test_example
33
  - install
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
34 35 36
  - optional


37 38


39
####### CODE QUALITY CHECK ##############
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
40

41
##########################################################
Ralf M Ulrich's avatar
quality  
Ralf M Ulrich committed
42 43 44 45 46 47 48
check-copyrights:
  image: corsika/devel:u-18.04
  stage: quality
  tags:
    - corsika
  script:
    - ./do-copyright.py
49 50 51
  rules:
    - if: $CI_MERGE_REQUEST_ID
    - if: $CI_COMMIT_TAG
52
    - if: $CI_COMMIT_BRANCH
53
  allow_failure: true
Ralf M Ulrich's avatar
quality  
Ralf M Ulrich committed
54

55
##########################################################
Ralf M Ulrich's avatar
quality  
Ralf M Ulrich committed
56 57 58 59 60 61 62
check-clang-format:
  image: corsika/devel:u-18.04
  stage: quality
  tags:
    - corsika
  script:
    - ./do-clang-format.py --all
63 64 65
  rules:
    - if: $CI_MERGE_REQUEST_ID
    - if: $CI_COMMIT_TAG
66
    - if: $CI_COMMIT_BRANCH
67
  allow_failure: true
Ralf M Ulrich's avatar
quality  
Ralf M Ulrich committed
68

69 70


71

72 73 74 75 76 77 78
####### CONFIG ##############

##########################################################
# the generic config template job
# job/stage to just prepare cmake
.config:
  stage: config
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
79 80
  tags:
    - corsika
Ralf Ulrich's avatar
Ralf Ulrich committed
81
  variables:
82 83
  before_script:
   - cd Data && for F in `find . -name "*.bz2" | grep -v ".git"`; do [ ! -f ${F%%.bz2} ] && bunzip2 -vk $F; done
Ralf Ulrich's avatar
Ralf Ulrich committed
84
   - cd ${CI_PROJECT_DIR}
Ralf Ulrich's avatar
Ralf Ulrich committed
85 86
  script:    
    - mkdir -p build
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
87
    - cd build
88 89 90 91
    - cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_PYTHIA=ON
  rules:
    - if: $CI_MERGE_REQUEST_ID
    - if: $CI_COMMIT_TAG
92
    - if: $CI_COMMIT_BRANCH
93
  cache: 
Ralf M Ulrich's avatar
Ralf M Ulrich committed
94
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
95 96
      - ${CI_PROJECT_DIR}/build/
      - ${CI_PROJECT_DIR}/Data/
97
    untracked: true
98
    policy: pull-push
Ralf M Ulrich's avatar
Ralf M Ulrich committed
99

100 101 102 103 104 105 106 107 108 109
# config for gcc
config-u-18_04:
  extends: .config
  image: corsika/devel:u-18.04
  cache:
    key: "${CI_COMMIT_REF_SLUG}-gcc"

# config for clang
config-clang-8:
  extends: .config
Ralf M Ulrich's avatar
Ralf M Ulrich committed
110
  image: corsika/devel:clang-8
111 112 113 114 115
  cache:
    key: "${CI_COMMIT_REF_SLUG}-clang"



116 117

####### BUILD (only manual) ##############
118 119 120 121 122

##########################################################
# the generic build template job
# normal pipeline for each commit
.build:
Ralf M Ulrich's avatar
Ralf M Ulrich committed
123 124 125 126 127 128
  stage: build
  tags:
    - corsika
  script:
    - cd build
    - cmake --build . -- -j4
129 130
  rules:
    - if: $CI_MERGE_REQUEST_ID
131
      when: manual
132
    - if: $CI_COMMIT_TAG
133
      when: manual
134
    - if: $CI_COMMIT_BRANCH
135 136
      when: manual
  allow_failure: true
137
  cache: 
Ralf M Ulrich's avatar
Ralf M Ulrich committed
138
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
139 140
      - ${CI_PROJECT_DIR}/build/
      - ${CI_PROJECT_DIR}/Data/
141
    untracked: true
142
    policy: pull-push
Ralf M Ulrich's avatar
Ralf M Ulrich committed
143

144 145 146
# build for gcc
build-u-18_04:
  extends: .build
Ralf M Ulrich's avatar
Ralf M Ulrich committed
147 148
  image: corsika/devel:u-18.04
  dependencies:
149 150 151
    - config-u-18_04
  cache:
    key: "${CI_COMMIT_REF_SLUG}-gcc"
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
152

153 154 155
# build for clang
build-clang-8: 
  extends: .build
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
156 157
  image: corsika/devel:clang-8
  dependencies:
158 159 160 161 162
    - config-clang-8
  cache:
    key: "${CI_COMMIT_REF_SLUG}-clang"


163 164 165


####### TEST (only manual)  ##############
166 167 168 169 170

##########################################################
# generic test template job
# normal pipeline for each commit
.test:
Ralf M Ulrich's avatar
Ralf M Ulrich committed
171
  stage: test
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
172 173 174 175
  tags:
    - corsika
  script:
    - cd build
176
    - set -o pipefail
177
    - ctest -j4 -VV | gzip -v -9 > test.log.gz 
178 179
  rules:
    - if: $CI_MERGE_REQUEST_ID
180
      when: manual
181
    - if: $CI_COMMIT_TAG
182
      when: manual
183
    - if: $CI_COMMIT_BRANCH
184 185
      when: manual
  allow_failure: true
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
186
  artifacts:
187
    when: always
188
    expire_in: 3 days
189 190
    reports:
      junit:
Ralf Ulrich's avatar
Ralf Ulrich committed
191
        - ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
192
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
193
      - ${CI_PROJECT_DIR}/build/test.log.gz
194 195
  cache: 
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
196 197
      - ${CI_PROJECT_DIR}/build/
      - ${CI_PROJECT_DIR}/Data/
198 199
    untracked: true
    policy: pull-push
Ralf M Ulrich's avatar
Ralf M Ulrich committed
200

201 202 203
# test for gcc
test-u-18_04:
  extends: .test
Ralf M Ulrich's avatar
Ralf M Ulrich committed
204 205 206
  image: corsika/devel:u-18.04
  dependencies:
    - build-u-18_04
207 208 209 210 211 212 213 214 215 216 217 218 219 220
  cache:
    key: "${CI_COMMIT_REF_SLUG}-gcc"

# test for clang
test-clang-8:
  extends: .test
  image: corsika/devel:clang-8
  dependencies:
    - build-clang-8
  cache:
    key: "${CI_COMMIT_REF_SLUG}-clang"



221

Ralf Ulrich's avatar
Ralf Ulrich committed
222
####### BUILD-TEST (all builds <= Draft, default) ##############
223 224 225 226 227 228 229 230 231 232 233 234 235 236

##########################################################
# the generic build_test template job
# normal pipeline for each commit
.build_test:
  stage: build_test
  tags:
    - corsika
  script:
    - cd build
    - cmake --build . -- -j4
    - set -o pipefail
    - ctest -j4 -VV | gzip -v -9 > test.log.gz 
  rules:
Ralf Ulrich's avatar
Ralf Ulrich committed
237
    - if: '$CI_MERGE_REQUEST_ID && $CI_MERGE_REQUEST_TITLE =~ /^Draft:/'
Ralf M Ulrich's avatar
failure  
Ralf M Ulrich committed
238
      allow_failure: false
239 240 241 242 243 244 245 246 247
    - if: $CI_MERGE_REQUEST_ID
      when: manual
      allow_failure: true
  allow_failure: true
  artifacts:
    when: always
    expire_in: 3 days
    reports:
      junit:
Ralf Ulrich's avatar
Ralf Ulrich committed
248
        - ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
249
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
250
      - ${CI_PROJECT_DIR}/build/test.log.gz
251 252
  cache: 
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
253 254
      - ${CI_PROJECT_DIR}/build/
      - ${CI_PROJECT_DIR}/Data/
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
    untracked: true
    policy: pull-push

# build_test for gcc
build_test-u-18_04:
  extends: .build_test
  image: corsika/devel:u-18.04
  dependencies:
    - config-u-18_04
  cache:
    key: "${CI_COMMIT_REF_SLUG}-gcc"

# build_test for clang
build_test-clang-8: 
  extends: .build_test
  image: corsika/devel:clang-8
  dependencies:
    - config-clang-8
  cache:
    key: "${CI_COMMIT_REF_SLUG}-clang"



####### EXAMPLE (only manual)  ##############
279 280 281 282 283

##########################################################
# generic example template job
# normal pipeline for each commit
.example:
Ralf M Ulrich's avatar
Ralf M Ulrich committed
284 285 286 287 288 289
  stage: example
  tags:
    - corsika
  script:
    - cd build
    - set -o pipefail
Ralf Ulrich's avatar
Ralf Ulrich committed
290
    - make -j4 run_examples | gzip -v -9 > examples.log.gz
291
  rules:
Ralf Ulrich's avatar
Ralf Ulrich committed
292
    - if: $CI_MERGE_REQUEST_ID
293
      when: manual
294
    - if: $CI_COMMIT_TAG
Ralf Ulrich's avatar
Ralf Ulrich committed
295
      when: manual
296
    - if: $CI_COMMIT_BRANCH
297 298
      when: manual
  allow_failure: true
Ralf M Ulrich's avatar
Ralf M Ulrich committed
299 300
  artifacts:
    when: always
301
    expire_in: 3 days
Ralf M Ulrich's avatar
Ralf M Ulrich committed
302
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
303
      - ${CI_PROJECT_DIR}/build/examples.log.gz
304 305
  cache: 
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
306 307
      - ${CI_PROJECT_DIR}/build/
      - ${CI_PROJECT_DIR}/Data/
308
    untracked: true
309
    policy: pull
Ralf M Ulrich's avatar
Ralf M Ulrich committed
310

311 312 313 314 315 316 317 318 319 320 321 322
# example for gcc
example-u-18_04: 
  extends: .example
  image: corsika/devel:u-18.04
  dependencies:
    - build-u-18_04
  cache:
    key: "${CI_COMMIT_REF_SLUG}-gcc"

# example for clang
example-clang-8:
  extends: .example
Ralf M Ulrich's avatar
Ralf M Ulrich committed
323 324 325
  image: corsika/devel:clang-8
  dependencies:
    - build-clang-8
326 327 328 329
  cache:
    key: "${CI_COMMIT_REF_SLUG}-clang"


330

Ralf Ulrich's avatar
Ralf Ulrich committed
331
####### BUILD-TEST-EXAMPLE (only non-Draft)  ##############
332 333 334 335 336 337 338 339 340 341

##########################################################
# generic example template job
# normal pipeline for each commit
.build_test_example:
  stage: build_test_example
  tags:
    - corsika
  script:
    - cd build
Ralf Ulrich's avatar
Ralf Ulrich committed
342
    - cmake --build . -- -j4
343
    - set -o pipefail
Ralf Ulrich's avatar
Ralf Ulrich committed
344
    - ctest -j4 -VV | gzip -v -9 > test.log.gz
345 346
    - make -j4 run_examples | gzip -v -9 > examples.log.gz
  rules:
Ralf Ulrich's avatar
Ralf Ulrich committed
347
    - if: '$CI_MERGE_REQUEST_ID && $CI_MERGE_REQUEST_TITLE =~ /^Draft:/'
348 349
      when: manual
      allow_failure: true
350
    - if: $CI_COMMIT_BRANCH
351 352 353 354 355 356 357 358 359
    - if: $CI_MERGE_REQUEST_ID
    - if: $CI_COMMIT_TAG
      when: manual
      allow_failure: true
  artifacts:
    when: always
    expire_in: 3 days
    reports:
      junit:
Ralf Ulrich's avatar
Ralf Ulrich committed
360
        - ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
361
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
362 363
      - ${CI_PROJECT_DIR}/build/examples.log.gz
      - ${CI_PROJECT_DIR}/build/test.log.gz
364 365
  cache: 
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
366 367
      - ${CI_PROJECT_DIR}/build/
      - ${CI_PROJECT_DIR}/Data/
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391
    untracked: true
    policy: pull

# build_test_example for gcc
build_test_example-u-18_04: 
  extends: .build_test_example
  image: corsika/devel:u-18.04
  dependencies:
    - config-u-18_04
  cache:
    key: "${CI_COMMIT_REF_SLUG}-gcc"

# build_test_example for clang
build_test_example-clang-8:
  extends: .build_test_example
  image: corsika/devel:clang-8
  dependencies:
    - config-clang-8
  cache:
    key: "${CI_COMMIT_REF_SLUG}-clang"




392 393 394 395 396 397 398
####### INSTALL  ##############

##########################################################
# generic install template job
# make install
.install:
  stage: install
Ralf M Ulrich's avatar
Ralf M Ulrich committed
399 400 401 402 403
  tags:
    - corsika
  script:
    - cd build
    - set -o pipefail
Ralf Ulrich's avatar
Ralf Ulrich committed
404
    - make -j2 install
405
  rules:
Ralf Ulrich's avatar
Ralf Ulrich committed
406
    - if: $CI_MERGE_REQUEST_ID
407
      when: manual
408
    - if: $CI_COMMIT_TAG
Ralf Ulrich's avatar
Ralf Ulrich committed
409
      when: manual
410
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
411
    - if: $CI_COMMIT_BRANCH
412 413
      when: manual
  allow_failure: true
414
  cache: 
Ralf M Ulrich's avatar
Ralf M Ulrich committed
415
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
416 417
      - ${CI_PROJECT_DIR}/build/
      - ${CI_PROJECT_DIR}/Data/
418
    untracked: true
419
    policy: pull
Ralf M Ulrich's avatar
Ralf M Ulrich committed
420

421 422 423
# install for gcc
install-u-18_04: 
  extends: .install
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
424 425
  image: corsika/devel:u-18.04
  dependencies:
426 427 428 429 430 431 432 433 434 435 436 437 438 439 440
    - build-u-18_04
  cache:
    key: "${CI_COMMIT_REF_SLUG}-gcc"

# install for clang
install-clang-8:
  extends: .install
  image: corsika/devel:clang-8
  dependencies:
    - build-clang-8
  cache:
    key: "${CI_COMMIT_REF_SLUG}-clang"



441

442 443 444 445 446 447
####### OPTIONAL ##############

##########################################################
# generic release template job
# optional release pipeline for each commit
.release:
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
448
  stage: optional
449 450 451
  tags:
    - corsika
  script:
452
    - cd build
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
453
    - cmake .. -DCMAKE_BUILD_TYPE=Release
454
    - cmake --build . -- -j4
455
    - set -o pipefail
456
    - ctest -j4 -VV | gzip -v -9 > test.log.gz 
Ralf Ulrich's avatar
Ralf Ulrich committed
457
    - make -j4 run_examples | gzip -v -9 > examples.log.gz
458 459 460 461 462 463 464 465 466 467 468 469 470
  rules:
    - if: '$CI_MERGE_REQUEST_LABELS =~ /Ready for code review/' # run on merge requests, if label 'Ready for code review' is set
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
      when: manual
      allow_failure: true
    - if: $CI_MERGE_REQUEST_ID
      when: manual
      allow_failure: true
    - if: $CI_COMMIT_TAG
      when: manual
      allow_failure: true
  cache: 
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
471 472
      - ${CI_PROJECT_DIR}/build/
      - ${CI_PROJECT_DIR}/Data/
473
    untracked: true
474
    policy: pull
475
  artifacts:
476
    when: always
477
    expire_in: 3 days
478 479
    reports:
      junit:
Ralf Ulrich's avatar
Ralf Ulrich committed
480
        - ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
481
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
482 483
      - ${CI_PROJECT_DIR}/build/test.log.gz
      - ${CI_PROJECT_DIR}/build/examples.log.gz
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
484

485 486 487 488 489 490 491 492 493 494
# release for gcc
release-full-u-18_04:
  extends: .release
  image: corsika/devel:u-18.04
  dependencies:
    - config-u-18_04
  cache:
    key: "${CI_COMMIT_REF_SLUG}-gcc"

# release for clang
Ralf M Ulrich's avatar
Ralf M Ulrich committed
495
release-full-clang-8: 
496
  extends: .release
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
497 498 499
  image: corsika/devel:clang-8
  dependencies:
    - config-clang-8
500 501 502
  cache:
    key: "${CI_COMMIT_REF_SLUG}-clang"

Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
503

504 505


506 507
##########################################################
# the coverage generation should either run when manually requested, OR always on the master
508

509
coverage:
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
510 511 512 513 514 515 516 517 518 519
  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
520
    - ctest -j4 -VV | gzip -v -9 > test.log.gz 
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
521 522
    - cmake --build . --target coverage
    - tar czf coverage-report.tar.gz coverage-report
Ralf Ulrich's avatar
Ralf Ulrich committed
523
  coverage: '/^.*functions\.+:\s(.*\%)\s/'
524 525 526 527 528 529 530 531 532
  rules:
    - if: '$CI_MERGE_REQUEST_LABELS =~ /Ready for code review/' # run on merge requests, if label 'Ready for code review' is set
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
    - if: $CI_MERGE_REQUEST_ID
      when: manual
      allow_failure: true
    - if: $CI_COMMIT_TAG
      when: manual
      allow_failure: true
533
  artifacts:
534
    when: always
535
    expire_in: 1 year
536
    paths:
537
      - ${CI_PROJECT_DIR}/build/test.log.gz
Ralf Ulrich's avatar
Ralf Ulrich committed
538
      - ${CI_PROJECT_DIR}/build/coverage-report.tar.gz
539 540
  cache: 
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
541 542
      - ${CI_PROJECT_DIR}/build/
      - ${CI_PROJECT_DIR}/Data/
543
    untracked: true
544 545
    policy: pull
    key: "${CI_COMMIT_REF_SLUG}-gcc"
Ralf Ulrich's avatar
Ralf Ulrich committed
546

Ralf Ulrich's avatar
Ralf Ulrich committed
547

548 549


550
##########################################################
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
551 552 553
documentation:
  image: corsika/devel:u-18.04
  dependencies:
554
    - config-u-18_04
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
555
  stage: optional
Ralf Ulrich's avatar
Ralf Ulrich committed
556
  tags:
Lukas Nellen's avatar
Lukas Nellen committed
557
    - corsika
558
  script:
Ralf Ulrich's avatar
Ralf Ulrich committed
559
    - cd build
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
560
    - cmake --build . --target doxygen -- -j4
Ralf Ulrich's avatar
Ralf Ulrich committed
561
    - mkdir -p .public
562
    - cp -r Documentation/Doxygen/html .public/
Ralf Ulrich's avatar
Ralf Ulrich committed
563
    - mv .public ../public
564 565 566 567 568 569 570 571 572 573 574
  rules:
    - if: '$CI_MERGE_REQUEST_LABELS =~ /Ready for code review/' # run on merge requests, if label 'Ready for code review' is set
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
      when: manual
      allow_failure: true
    - if: $CI_MERGE_REQUEST_ID
      when: manual
      allow_failure: true
    - if: $CI_COMMIT_TAG
      when: manual
      allow_failure: true
575
  artifacts:
576
    expire_in: 3 weeks
577
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
578
      - ${CI_PROJECT_DIR}/public
579 580
  cache: 
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
581 582
      - ${CI_PROJECT_DIR}/build/
      - ${CI_PROJECT_DIR}/Data/
583
    untracked: true
584 585 586
    policy: pull
    key: "${CI_COMMIT_REF_SLUG}-gcc"

Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
587

588

589
##########################################################
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
590 591 592 593 594 595 596 597 598 599 600
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
601 602 603 604 605 606 607 608 609 610 611 612 613
  rules:
    - if: '$CI_MERGE_REQUEST_LABELS =~ /Ready for code review/' # run on merge requests, if label 'Ready for code review' is set
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
      when: manual
      allow_failure: true
    - if: $CI_MERGE_REQUEST_ID
      when: manual
      allow_failure: true
    - if: $CI_COMMIT_TAG
      when: manual
      allow_failure: true
  cache: 
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
614 615
      - ${CI_PROJECT_DIR}/build/
      - ${CI_PROJECT_DIR}/Data/
616
    untracked: true
617 618
    policy: pull
    key: "${CI_COMMIT_REF_SLUG}-gcc"