IAP GITLAB

.gitlab-ci.yml 14.4 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
Remy Prechelt's avatar
Remy Prechelt committed
31
  - python
Ralf M Ulrich's avatar
Ralf M Ulrich committed
32
  - example
33
  - build_test_example
34
  - install
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
35 36 37
  - optional


38 39


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

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

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

70 71


72

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

##########################################################
# the generic config template job
# job/stage to just prepare cmake
.config:
  stage: config
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
80 81
  tags:
    - corsika
Ralf Ulrich's avatar
Ralf Ulrich committed
82
  variables:
83 84
  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
85
   - cd ${CI_PROJECT_DIR}
Ralf Ulrich's avatar
Ralf Ulrich committed
86 87
  script:    
    - mkdir -p build
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
88
    - cd build
89 90 91 92
    - cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_PYTHIA=ON
  rules:
    - if: $CI_MERGE_REQUEST_ID
    - if: $CI_COMMIT_TAG
93
    - if: $CI_COMMIT_BRANCH
94
  cache: 
Ralf M Ulrich's avatar
Ralf M Ulrich committed
95
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
96 97
      - ${CI_PROJECT_DIR}/build/
      - ${CI_PROJECT_DIR}/Data/
98
    untracked: true
99
    policy: pull-push
Ralf M Ulrich's avatar
Ralf M Ulrich committed
100

101 102 103 104 105 106 107 108 109 110
# 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
111
  image: corsika/devel:clang-8
112 113 114 115 116
  cache:
    key: "${CI_COMMIT_REF_SLUG}-clang"



117 118

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

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

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

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


164 165 166


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

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

202 203 204
# test for gcc
test-u-18_04:
  extends: .test
Ralf M Ulrich's avatar
Ralf M Ulrich committed
205 206 207
  image: corsika/devel:u-18.04
  dependencies:
    - build-u-18_04
208 209 210 211 212 213 214 215 216 217 218 219 220 221
  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"



222

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

##########################################################
# 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
238
    - if: '$CI_MERGE_REQUEST_ID && $CI_MERGE_REQUEST_TITLE =~ /^Draft:/'
Ralf M Ulrich's avatar
failure  
Ralf M Ulrich committed
239
      allow_failure: false
240 241 242 243 244 245 246 247 248
    - 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
249
        - ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
250
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
251
      - ${CI_PROJECT_DIR}/build/test.log.gz
252 253
  cache: 
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
254 255
      - ${CI_PROJECT_DIR}/build/
      - ${CI_PROJECT_DIR}/Data/
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279
    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)  ##############
280 281 282 283 284

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

312 313 314 315 316 317 318 319 320 321 322 323
# 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
324 325 326
  image: corsika/devel:clang-8
  dependencies:
    - build-clang-8
327 328 329 330
  cache:
    key: "${CI_COMMIT_REF_SLUG}-clang"


331

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

##########################################################
# 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
343
    - cmake --build . -- -j4
344
    - set -o pipefail
Ralf Ulrich's avatar
Ralf Ulrich committed
345
    - ctest -j4 -VV | gzip -v -9 > test.log.gz
346 347
    - make -j4 run_examples | gzip -v -9 > examples.log.gz
  rules:
Ralf Ulrich's avatar
Ralf Ulrich committed
348
    - if: '$CI_MERGE_REQUEST_ID && $CI_MERGE_REQUEST_TITLE =~ /^Draft:/'
349 350
      when: manual
      allow_failure: true
351
    - if: $CI_COMMIT_BRANCH
352 353 354 355 356 357 358 359 360
    - 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
361
        - ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
362
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
363 364
      - ${CI_PROJECT_DIR}/build/examples.log.gz
      - ${CI_PROJECT_DIR}/build/test.log.gz
365 366
  cache: 
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
367 368
      - ${CI_PROJECT_DIR}/build/
      - ${CI_PROJECT_DIR}/Data/
369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392
    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"




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

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

422 423 424
# install for gcc
install-u-18_04: 
  extends: .install
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
425 426
  image: corsika/devel:u-18.04
  dependencies:
427 428 429 430 431 432 433 434 435 436 437 438 439 440 441
    - 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"



442

443 444 445 446 447 448
####### OPTIONAL ##############

##########################################################
# generic release template job
# optional release pipeline for each commit
.release:
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
449
  stage: optional
450 451 452
  tags:
    - corsika
  script:
453
    - cd build
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
454
    - cmake .. -DCMAKE_BUILD_TYPE=Release
455
    - cmake --build . -- -j4
456
    - set -o pipefail
457
    - ctest -j4 -VV | gzip -v -9 > test.log.gz 
Ralf Ulrich's avatar
Ralf Ulrich committed
458
    - make -j4 run_examples | gzip -v -9 > examples.log.gz
459 460 461 462 463 464 465 466 467 468 469 470 471
  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
472 473
      - ${CI_PROJECT_DIR}/build/
      - ${CI_PROJECT_DIR}/Data/
474
    untracked: true
475
    policy: pull
476
  artifacts:
477
    when: always
478
    expire_in: 3 days
479 480
    reports:
      junit:
Ralf Ulrich's avatar
Ralf Ulrich committed
481
        - ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
482
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
483 484
      - ${CI_PROJECT_DIR}/build/test.log.gz
      - ${CI_PROJECT_DIR}/build/examples.log.gz
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
485

486 487 488 489 490 491 492 493 494 495
# 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
496
release-full-clang-8: 
497
  extends: .release
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
498 499 500
  image: corsika/devel:clang-8
  dependencies:
    - config-clang-8
501 502 503
  cache:
    key: "${CI_COMMIT_REF_SLUG}-clang"

Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
504

505 506


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

510
coverage:
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
511 512 513 514 515 516 517 518 519 520
  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
521
    - ctest -j4 -VV | gzip -v -9 > test.log.gz 
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
522 523
    - cmake --build . --target coverage
    - tar czf coverage-report.tar.gz coverage-report
Ralf Ulrich's avatar
Ralf Ulrich committed
524
  coverage: '/^.*functions\.+:\s(.*\%)\s/'
525 526 527 528 529 530 531 532 533
  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
534
  artifacts:
535
    when: always
536
    expire_in: 1 year
537
    paths:
538
      - ${CI_PROJECT_DIR}/build/test.log.gz
Ralf Ulrich's avatar
Ralf Ulrich committed
539
      - ${CI_PROJECT_DIR}/build/coverage-report.tar.gz
540 541
  cache: 
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
542 543
      - ${CI_PROJECT_DIR}/build/
      - ${CI_PROJECT_DIR}/Data/
544
    untracked: true
545 546
    policy: pull
    key: "${CI_COMMIT_REF_SLUG}-gcc"
Ralf Ulrich's avatar
Ralf Ulrich committed
547

Ralf Ulrich's avatar
Ralf Ulrich committed
548

549 550


551
##########################################################
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
552 553 554
documentation:
  image: corsika/devel:u-18.04
  dependencies:
555
    - config-u-18_04
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
556
  stage: optional
Ralf Ulrich's avatar
Ralf Ulrich committed
557
  tags:
Lukas Nellen's avatar
Lukas Nellen committed
558
    - corsika
559
  script:
Ralf Ulrich's avatar
Ralf Ulrich committed
560
    - cd build
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
561
    - cmake --build . --target doxygen -- -j4
Ralf Ulrich's avatar
Ralf Ulrich committed
562
    - mkdir -p .public
563
    - cp -r Documentation/Doxygen/html .public/
Ralf Ulrich's avatar
Ralf Ulrich committed
564
    - mv .public ../public
565 566 567 568 569 570 571 572 573 574 575
  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
576
  artifacts:
577
    expire_in: 3 weeks
578
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
579
      - ${CI_PROJECT_DIR}/public
580 581
  cache: 
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
582 583
      - ${CI_PROJECT_DIR}/build/
      - ${CI_PROJECT_DIR}/Data/
584
    untracked: true
585 586 587
    policy: pull
    key: "${CI_COMMIT_REF_SLUG}-gcc"

Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
588

589

590
##########################################################
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
591 592 593 594 595 596 597 598 599 600 601
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
602 603 604 605 606 607 608 609 610 611 612 613 614
  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
615 616
      - ${CI_PROJECT_DIR}/build/
      - ${CI_PROJECT_DIR}/Data/
617
    untracked: true
618 619
    policy: pull
    key: "${CI_COMMIT_REF_SLUG}-gcc"
Remy Prechelt's avatar
Remy Prechelt committed
620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652



##########################################################
# template for all Python jobs
.python:
  stage: python
  tags:
    - corsika
  script:
    - cd ${CI_PROJECT_DIR}/Python  # change into the Python directory
    - pip install --user -e '.[test]'  # install the package + test deps
    - make all 2&>1 | tee python-test.log  # this runs all of the Python tests
    - cd ${CI_PROJECT_DIR}  # reset the directory
  artifacts:
    when: always
    expire_in: 1 year
    paths:
      - ${CI_PROJECT_DIR}/Python/python-test.log

# we now configure the jobs for the three
# supported Python versions
python-3.6:
  extends: .python
  image: python:3.6

python-3.7:
  extends: .python
  image: python:3.7

python-3.8:
  extends: .python
  image: python:3.8