IAP GITLAB

.gitlab-ci.yml 12.9 KB
Newer Older
Ralf Ulrich's avatar
Ralf Ulrich committed
1
variables:
Ralf M Ulrich's avatar
Ralf M Ulrich committed
2
  GIT_STRATEGY: $CORSIKA8_GIT_STRATEGY # clone: fresh clone, fetch: update
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
Ralf Ulrich's avatar
Ralf Ulrich committed
14
  CORSIKA_DATA: "${CI_PROJECT_DIR}/modules/data" # the git submodule
Ralf Ulrich's avatar
Ralf Ulrich committed
15
  corsika_DIR: "${CI_PROJECT_DIR}/build/install" # for cmake to find corsikaConfig.cmake
16
  # _alternatively_ corsika-data can be downloaded as submodule:
Ralf Ulrich's avatar
Ralf Ulrich committed
17 18
  GIT_SUBMODULE_STRATEGY: normal # none: we get the submodules in before_script,
                                 # normal: get submodules automatically
19
  CTEST_OUTPUT_ON_FAILURE: 1
20 21 22 23 24


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


41 42


43
####### CODE QUALITY CHECK ##############
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
44

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

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

Ralf Ulrich's avatar
Ralf Ulrich committed
73
### CodeQuality tool ####
Ralf Ulrich's avatar
Ralf Ulrich committed
74 75 76 77 78 79 80 81 82 83 84
#include:
#  - template: Code-Quality.gitlab-ci.yml
#
#code_quality:
#  stage: quality
#  rules:
#    - if: '$CODE_QUALITY_DISABLED'
#      when: never
#    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' # Run code quality job in merge request pipelines
#    - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'      # Run code quality job in pipelines on the master branch (but not in other branch pipelines)
#    - if: '$CI_COMMIT_TAG'                               # Run code quality job in pipelines for tags
85

86 87 88 89 90 91 92
####### CONFIG ##############

##########################################################
# the generic config template job
# job/stage to just prepare cmake
.config:
  stage: config
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
93 94
  tags:
    - corsika
Ralf Ulrich's avatar
Ralf Ulrich committed
95
  script:
Ralf Ulrich's avatar
Ralf Ulrich committed
96
    - mkdir -p build
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
97
    - cd build
98
    - cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_Pythia8_C8=C8
99 100 101
  rules:
    - if: $CI_MERGE_REQUEST_ID
    - if: $CI_COMMIT_TAG
102
    - if: $CI_COMMIT_BRANCH
Ralf Ulrich's avatar
Ralf Ulrich committed
103 104 105 106 107
  artifacts:
    when: on_failure
    expire_in: 3 days
    paths:
      - ${CI_PROJECT_DIR}/build/CMakeFiles/CMakeOutput.log
Ralf M Ulrich's avatar
Ralf M Ulrich committed
108

109 110 111 112 113 114 115 116
# config for gcc
config-u-18_04:
  extends: .config
  image: corsika/devel:u-18.04

# config for clang
config-clang-8:
  extends: .config
Ralf M Ulrich's avatar
Ralf M Ulrich committed
117
  image: corsika/devel:clang-8
118 119 120



121 122

####### BUILD (only manual) ##############
123 124 125 126 127

##########################################################
# the generic build template job
# normal pipeline for each commit
.build:
Ralf M Ulrich's avatar
Ralf M Ulrich committed
128 129 130 131
  stage: build
  tags:
    - corsika
  script:
Ralf Ulrich's avatar
Ralf Ulrich committed
132
    - mkdir -p build
Ralf M Ulrich's avatar
Ralf M Ulrich committed
133
    - cd build
Ralf Ulrich's avatar
Ralf Ulrich committed
134
    - cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_Pythia8_C8=C8
Ralf M Ulrich's avatar
Ralf M Ulrich committed
135
    - cmake --build . -- -j4
136 137
  rules:
    - if: $CI_MERGE_REQUEST_ID
138
      when: manual
139
    - if: $CI_COMMIT_TAG
140
      when: manual
141
    - if: $CI_COMMIT_BRANCH
142 143
      when: manual
  allow_failure: true
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
  image: corsika/devel:u-18.04
Ralf Ulrich's avatar
Ralf Ulrich committed
149 150 151
  needs: 
    - job: config-u-18_04
      artifacts: false
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
152

153
# build for clang
154
build-clang-8:
155
  extends: .build
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
156
  image: corsika/devel:clang-8
Ralf Ulrich's avatar
Ralf Ulrich committed
157 158 159
  needs:
    - job: config-clang-8
      artifacts: false
160

161 162 163


####### TEST (only manual)  ##############
164 165 166 167 168

##########################################################
# generic test template job
# normal pipeline for each commit
.test:
Ralf M Ulrich's avatar
Ralf M Ulrich committed
169
  stage: test
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
170 171 172
  tags:
    - corsika
  script:
Ralf Ulrich's avatar
Ralf Ulrich committed
173
    - mkdir -p build
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
174
    - cd build
Ralf Ulrich's avatar
Ralf Ulrich committed
175
    - cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_Pythia8_C8=C8
176
    - set -o pipefail
Ralf Ulrich's avatar
Ralf Ulrich committed
177
    - ctest -j4 
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 M Ulrich's avatar
Ralf M Ulrich committed
192

193 194 195
# test for gcc
test-u-18_04:
  extends: .test
Ralf M Ulrich's avatar
Ralf M Ulrich committed
196
  image: corsika/devel:u-18.04
Ralf Ulrich's avatar
Ralf Ulrich committed
197 198 199
  needs:
    - job: build-u-18_04
      artifacts: false
200 201 202 203 204

# test for clang
test-clang-8:
  extends: .test
  image: corsika/devel:clang-8
Ralf Ulrich's avatar
Ralf Ulrich committed
205 206 207
  needs:
    - job: build-clang-8
      artifacts: false
208 209 210



211

Ralf Ulrich's avatar
Ralf Ulrich committed
212
####### BUILD-TEST (all builds <= Draft, default) ##############
213 214 215 216 217 218 219 220 221

##########################################################
# the generic build_test template job
# normal pipeline for each commit
.build_test:
  stage: build_test
  tags:
    - corsika
  script:
Ralf Ulrich's avatar
Ralf Ulrich committed
222
    - mkdir -p build
223
    - cd build
Ralf Ulrich's avatar
Ralf Ulrich committed
224
    - cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_Pythia8_C8=C8
Ralf Ulrich's avatar
Ralf Ulrich committed
225
    - cmake --build . -- -j4
226
    - set -o pipefail
Ralf Ulrich's avatar
Ralf Ulrich committed
227
    - ctest -j4 
228
  rules:
Ralf Ulrich's avatar
Ralf Ulrich committed
229
    - if: '$CI_MERGE_REQUEST_ID && $CI_MERGE_REQUEST_TITLE =~ /^Draft:/'
Ralf M Ulrich's avatar
failure  
Ralf M Ulrich committed
230
      allow_failure: false
231 232 233 234 235 236
    - if: $CI_MERGE_REQUEST_ID
      when: manual
      allow_failure: true
  artifacts:
    when: always
    expire_in: 3 days
Ralf Ulrich's avatar
Ralf Ulrich committed
237 238
    paths:
      - ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
239 240
    reports:
      junit:
Ralf Ulrich's avatar
Ralf Ulrich committed
241
        - ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
242 243 244 245 246

# build_test for gcc
build_test-u-18_04:
  extends: .build_test
  image: corsika/devel:u-18.04
Ralf Ulrich's avatar
Ralf Ulrich committed
247 248 249
  needs:
    - job: config-u-18_04
      artifacts: false
250 251

# build_test for clang
252
build_test-clang-8:
253 254
  extends: .build_test
  image: corsika/devel:clang-8
Ralf Ulrich's avatar
Ralf Ulrich committed
255 256 257
  needs:
    - job: config-clang-8
      artifacts: false
258 259 260



261

262

Ralf Ulrich's avatar
Ralf Ulrich committed
263
####### BUILD-TEST-EXAMPLE (only non-Draft)  ##############
264 265 266 267 268 269 270 271 272

##########################################################
# generic example template job
# normal pipeline for each commit
.build_test_example:
  stage: build_test_example
  tags:
    - corsika
  script:
Ralf Ulrich's avatar
Ralf Ulrich committed
273
    - mkdir -p build
274
    - cd build
Ralf Ulrich's avatar
Ralf Ulrich committed
275
    - cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_Pythia8_C8=C8
Ralf Ulrich's avatar
Ralf Ulrich committed
276
    - cmake --build . -- -j4
277
    - set -o pipefail
278 279
    - ctest -j4
    - make install
Ralf Ulrich's avatar
Ralf Ulrich committed
280 281
    - mkdir -p build_examples
    - cd build_examples
Ralf Ulrich's avatar
Ralf Ulrich committed
282
    - cmake -DCMAKE_BUILT_TYPE=Debug ../install/share/corsika/examples
283
    - make -j4
Ralf Ulrich's avatar
Ralf Ulrich committed
284
    - make -j4 run_examples | gzip -v -9 > examples.log.gz
285
  rules:
Ralf Ulrich's avatar
Ralf Ulrich committed
286
    - if: '$CI_MERGE_REQUEST_ID && $CI_MERGE_REQUEST_TITLE =~ /^Draft:/'
287 288
      when: manual
      allow_failure: true
289
    - if: $CI_COMMIT_BRANCH
290 291 292 293 294 295 296 297 298
    - 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
299
        - ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
300
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
301
      - ${CI_PROJECT_DIR}/build/build_examples/examples.log.gz
Ralf Ulrich's avatar
Ralf Ulrich committed
302
      - ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
303 304

# build_test_example for gcc
305
build_test_example-u-18_04:
306 307
  extends: .build_test_example
  image: corsika/devel:u-18.04
Ralf Ulrich's avatar
Ralf Ulrich committed
308 309 310 311
  needs:
    - job: config-u-18_04
      artifacts: false

312 313 314 315 316

# build_test_example for clang
build_test_example-clang-8:
  extends: .build_test_example
  image: corsika/devel:clang-8
Ralf Ulrich's avatar
Ralf Ulrich committed
317 318 319
  needs:
    - job: config-clang-8
      artifacts: false
320 321 322 323




324 325 326 327 328 329 330
####### INSTALL  ##############

##########################################################
# generic install template job
# make install
.install:
  stage: install
Ralf M Ulrich's avatar
Ralf M Ulrich committed
331 332 333
  tags:
    - corsika
  script:
Ralf Ulrich's avatar
Ralf Ulrich committed
334
    - mkdir -p build
Ralf M Ulrich's avatar
Ralf M Ulrich committed
335
    - cd build
Ralf Ulrich's avatar
Ralf Ulrich committed
336
    - cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_BUILD_TYPE=Debug -DUSE_Pythia8_C8=C8
Ralf M Ulrich's avatar
Ralf M Ulrich committed
337
    - set -o pipefail
Ralf Ulrich's avatar
Ralf Ulrich committed
338
    - make -j2 install
339
  rules:
Ralf Ulrich's avatar
Ralf Ulrich committed
340 341 342 343
    - 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
Ralf Ulrich's avatar
Ralf Ulrich committed
344
    - if: $CI_MERGE_REQUEST_ID
345
      when: manual
Ralf Ulrich's avatar
Ralf Ulrich committed
346
      allow_failure: true
347
    - if: $CI_COMMIT_TAG
Ralf Ulrich's avatar
Ralf Ulrich committed
348
      when: manual
Ralf Ulrich's avatar
Ralf Ulrich committed
349
      allow_failure: true
Ralf M Ulrich's avatar
Ralf M Ulrich committed
350

351
# install for gcc
352
install-u-18_04:
353
  extends: .install
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
354
  image: corsika/devel:u-18.04
Ralf Ulrich's avatar
Ralf Ulrich committed
355 356 357
  needs:
    - job: build-u-18_04
      artifacts: false
358 359 360 361 362

# install for clang
install-clang-8:
  extends: .install
  image: corsika/devel:clang-8
Ralf Ulrich's avatar
Ralf Ulrich committed
363 364 365
  needs:
    - job: build-clang-8
      artifacts: false
366 367 368



369

370 371 372 373 374 375
####### OPTIONAL ##############

##########################################################
# generic release template job
# optional release pipeline for each commit
.release:
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
376
  stage: optional
377 378 379
  tags:
    - corsika
  script:
Ralf Ulrich's avatar
Ralf Ulrich committed
380
    - mkdir -p build
381
    - cd build
382
    - cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_Pythia8_C8=C8
383
    - cmake --build . -- -j4
384
    - set -o pipefail
385 386
    - ctest -j4
    - make install
Ralf Ulrich's avatar
Ralf Ulrich committed
387 388
    - mkdir -p build_examples
    - cd build_examples
Ralf Ulrich's avatar
Ralf Ulrich committed
389
    - cmake -DCMAKE_BUILT_TYPE=Release ../install/share/corsika/examples
390
    - make -j4
Ralf Ulrich's avatar
Ralf Ulrich committed
391
    - make -j4 run_examples | gzip -v -9 > examples.log.gz
392 393 394 395 396 397 398 399 400 401 402
  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
403
  artifacts:
404
    when: always
405
    expire_in: 3 days
406 407
    reports:
      junit:
Ralf Ulrich's avatar
Ralf Ulrich committed
408
        - ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
409
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
410
      - ${CI_PROJECT_DIR}/build/build_examples/examples.log.gz
Ralf Ulrich's avatar
Ralf Ulrich committed
411
      - ${CI_PROJECT_DIR}/build/test_outputs/junit*.xml
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
412

413 414 415 416
# release for gcc
release-full-u-18_04:
  extends: .release
  image: corsika/devel:u-18.04
Ralf Ulrich's avatar
Ralf Ulrich committed
417 418 419
  needs:
    - job: config-u-18_04
      artifacts: false
420 421

# release for clang
422
release-full-clang-8:
423
  extends: .release
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
424
  image: corsika/devel:clang-8
Ralf Ulrich's avatar
Ralf Ulrich committed
425 426 427
  needs:
    - job: config-clang-8
      artifacts: false
428

Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
429

430 431


432 433
##########################################################
# the coverage generation should either run when manually requested, OR always on the master
434

435
coverage:
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
436
  image: corsika/devel:u-18.04
Ralf Ulrich's avatar
Ralf Ulrich committed
437 438 439
  needs:
    - job: config-u-18_04
      artifacts: false
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
440 441 442 443
  stage: optional
  tags:
    - corsika
  script:
Ralf Ulrich's avatar
Ralf Ulrich committed
444
    - mkdir -p build
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
445
    - cd build
446
    - cmake .. -DCMAKE_BUILD_TYPE=Coverage -DUSE_Pythia8_C8=C8
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
447
    - cmake --build . -- -j4
Ralf Ulrich's avatar
Ralf Ulrich committed
448
    - ctest -j4 
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
449 450
    - cmake --build . --target coverage
    - tar czf coverage-report.tar.gz coverage-report
451
  coverage: '/^.*lines\.+:\s(.*\%)\s/'
452 453 454 455 456 457 458 459 460
  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
461
  artifacts:
462
    when: always
463
    expire_in: 1 year
464
    paths:
Ralf Ulrich's avatar
Ralf Ulrich committed
465
      - ${CI_PROJECT_DIR}/build/coverage-report.tar.gz
Ralf Ulrich's avatar
Ralf Ulrich committed
466

Ralf Ulrich's avatar
Ralf Ulrich committed
467

468 469


470

Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
471

472

473
##########################################################
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
474 475
sanity:
  image: corsika/devel:u-18.04
Ralf Ulrich's avatar
Ralf Ulrich committed
476 477 478 479
  needs:
    - job: config-u-18_04
      artifacts: false

Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
480 481 482 483
  stage: optional
  tags:
    - corsika
  script:
Ralf Ulrich's avatar
Ralf Ulrich committed
484
    - mkdir -p build
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
485
    - cd build
Ralf Ulrich's avatar
Ralf Ulrich committed
486
    - cmake .. -DWITH_CORSIKA_SANITIZERS_ENABLED=ON -DCMAKE_BUILD_TYPE=Debug -DUSE_Pythia8_C8=C8
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
487
    - cmake --build . -- -j4
488 489 490 491 492 493 494 495 496 497 498
  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
Remy Prechelt's avatar
Remy Prechelt committed
499

500 501 502 503 504 505 506 507
##########################################################
# template for all Python jobs
.python:
  stage: python
  tags:
    - corsika
  before_script:
    - apt-get update && apt-get install -y python3-pip
Ralf Ulrich's avatar
Ralf Ulrich committed
508
    - pip3 install --upgrade cython
509
  script:
Ralf Ulrich's avatar
Ralf Ulrich committed
510
    - cd ${CI_PROJECT_DIR}/python  # change into the Python directory
511 512 513 514 515 516 517 518 519 520 521 522 523 524
    - pip3 install --user -e '.[test]'  # install the package + test deps
    - python3 --version
    - python3 -m mypy corsika
    - python3 -m isort --atomic --check-only corsika tests
    - python3 -m black -t py37 corsika tests
    - python3 -m flake8 corsika tests
    - python3 -m pytest --cov=corsika tests
    - cd ${CI_PROJECT_DIR}  # reset the directory
  coverage: '/^TOTAL\s*\d+\s*\d+\s*(.*\%)/'

# the default Python version Ubuntu 18.04 is Python3.8
python-3.8:
  extends: .python
  image: corsika/devel:u-18.04
Ralf Ulrich's avatar
Ralf Ulrich committed
525 526 527
  needs:
    - job: build-u-18_04
      artifacts: false
528 529 530 531 532 533
  artifacts:
    when: always
    expire_in: 1 year
    paths:
      - ${CI_PROJECT_DIR}/Python/python-test.log
  allow_failure: true