IAP GITLAB

Skip to content
Snippets Groups Projects
.gitlab-ci.yml 4.31 KiB
Newer Older
ralfulrich's avatar
ralfulrich committed
variables:
  GIT_SSL_NO_VERIFY: "1"
  ## 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"
ralfulrich's avatar
ralfulrich committed

Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
# normal multi-step pipeline for each commit
stages:
  - config
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
  - 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
  tags:
    - corsika
  script:
    - mkdir build
    - cd build
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
    - cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_PYTHIA=ON
  artifacts:
    expire_in: 1 day
    paths:
       - build

# normal pipeline for each commit
ralfulrich's avatar
ralfulrich committed
build-test-u-18_04: 
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
  image: corsika/devel:u-18.04
  dependencies:
    - config-u-18_04
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
  tags:
    - corsika
  script:
    - cd build
    - cmake --build . -- -j4
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
    - set -o pipefail
    - ctest -VV | gzip -v -9 > test.log.gz 
  artifacts:
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
    reports:
      junit:
        - build/test_outputs/junit*.xml
    paths:
      - build/test.log.gz
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed

# normal pipeline for each commit
ralfulrich's avatar
ralfulrich committed
build-test-clang-8: 
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
  image: corsika/devel:clang-8
  dependencies:
    - config-clang-8
  stage: build_test
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
  tags:
    - corsika
  script:
    - cd build
    - cmake --build . -- -j4
    - set -o pipefail
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
    - ctest -VV | gzip -v -9 > test.log.gz 
  artifacts:
    reports:
      junit:
        - build/test_outputs/junit*.xml
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
    paths:
      - build/test.log.gz
 
# optional release pipeline for each commit
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
release-u-18_04: 
  image: corsika/devel:u-18.04
  dependencies:
    - config-u-18_04
  stage: optional
  tags:
    - corsika
  script:
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
    - cmake .. -DCMAKE_BUILD_TYPE=Release
    - cmake --build . -- -j4
    - 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
  when: manual    

# optional release pipeline for each commit
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
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
    - 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
  when: manual    

ralfulrich's avatar
ralfulrich committed
# 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
  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
  coverage: '/^.*functions\.+:\s(.*\%)\s/'
    expire_in: 1 year
      - build/coverage-report.tar.gz
coverage: # special manual job to run after normal pipeline on branch finished 
ralfulrich's avatar
ralfulrich committed
  <<: *coverage_job
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
  when: manual    
  except:
    refs:
      - master
ralfulrich's avatar
ralfulrich committed

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

Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
documentation:
  image: corsika/devel:u-18.04
  dependencies:
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
  stage: optional
ralfulrich's avatar
ralfulrich committed
  tags:
    - corsika
ralfulrich's avatar
ralfulrich committed
    - cd build
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
    - cmake --build . --target doxygen -- -j4
    - mkdir .public
    - cp -r Documentation/Doxygen/html .public/
ralfulrich's avatar
ralfulrich committed
    - mv .public ../public
  artifacts:
    paths:
      - public
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
  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