IAP GITLAB

.gitlab-ci.yml 3.97 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 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
# normal multi-step pipeline for each commit
stages:
  - config
  - build
  - test
  - release
  - 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
37 38 39 40 41
  tags:
    - corsika
  script:
    - mkdir build
    - cd build
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
    - cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_PYTHIA=ON
  artifacts:
    expire_in: 1 day
    paths:
       - build

# normal pipeline for each commit
build-u-18_04: 
  image: corsika/devel:u-18.04
  dependencies:
    - config-u-18_04
  stage: build
  tags:
    - corsika
  script:
    - cd build
58 59
    - cmake --build . -- -j4
  artifacts:
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
    expire_in: 1 day
    paths:
       - build

# normal pipeline for each commit
build-clang-8: 
  image: corsika/devel:clang-8
  dependencies:
    - config-clang-8
  stage: build
  tags:
    - corsika
  script:
    - cd build
    - cmake --build . -- -j4
  artifacts:
    expire_in: 1 day
    paths:
       - build

test-u-18_04: 
  image: corsika/devel:u-18.04
  dependencies:
    - build-u-18_04
  stage: test
  tags:
    - corsika
  script:
    - set -o pipefail
    - cd build
    - ctest -VV | gzip -v -9 > test.log.gz 
  artifacts:
    expire_in: 3 months
    reports:
      junit:
        - build/test_outputs/junit*.xml
96 97
    paths:
      - build/test.log.gz
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
98 99 100 101 102 103 104 105 106 107 108 109 110 111

test-clang-8: 
  image: corsika/devel:clang-8
  dependencies:
    - build-clang-8
  stage: test
  tags:
    - corsika
  script:
    - set -o pipefail
    - cd build
    - ctest -VV | gzip -v -9 > test.log.gz 
  artifacts:
    expire_in: 3 months
112 113 114
    reports:
      junit:
        - build/test_outputs/junit*.xml
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
115 116
    paths:
      - build/test.log.gz
117

Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
118 119 120 121 122 123
# normal pipeline for each commit
release-u-18_04: 
  image: corsika/devel:u-18.04
  dependencies:
    - config-u-18_04
  stage: optional
124 125 126
  tags:
    - corsika
  script:
127
    - cd build
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
128
    - cmake .. -DCMAKE_BUILD_TYPE=Release
129
    - cmake --build . -- -j4
130
    - ctest -j4 
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
131 132 133 134 135 136 137 138 139 140 141 142 143 144 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    

coverage: # special manual job to run after normal pipeline finished 
  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
162
  coverage: '/^.*functions\.+:\s(.*\%)\s/'
163
  artifacts:
164
    expire_in: 1 year
165
    paths:
166
      - build/coverage-report.tar.gz
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
167 168
  when: manual    
  allow_failure: true
Ralf Ulrich's avatar
Ralf Ulrich committed
169

Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
170 171 172 173 174
documentation:
  image: corsika/devel:u-18.04
  dependencies:
    - build-u-18_04
  stage: optional
Ralf Ulrich's avatar
Ralf Ulrich committed
175
  tags:
Lukas Nellen's avatar
Lukas Nellen committed
176
    - corsika
177
  script:
Ralf Ulrich's avatar
Ralf Ulrich committed
178
    - cd build
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
179
    - cmake --build . --target doxygen -- -j4
180 181
    - mkdir .public
    - cp -r Documentation/Doxygen/html .public/
Ralf Ulrich's avatar
Ralf Ulrich committed
182
    - mv .public ../public
183
  artifacts:
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
184
    expire_in: 3 months
185 186
    paths:
      - public
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203
  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