IAP GITLAB

.gitlab-ci.yml 4.25 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
  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    

Ralf Ulrich's avatar
Ralf Ulrich committed
148 149
# 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
150 151 152 153 154 155 156 157 158 159 160 161 162
  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
163
  coverage: '/^.*functions\.+:\s(.*\%)\s/'
164
  artifacts:
165
    expire_in: 1 year
166
    paths:
167
      - build/coverage-report.tar.gz
Ralf Ulrich's avatar
Ralf Ulrich committed
168

Ralf Ulrich's avatar
Ralf Ulrich committed
169
coverage: # special manual job to run after normal pipeline on branch finished 
Ralf Ulrich's avatar
Ralf Ulrich committed
170
  <<: *coverage_job
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
171
  when: manual    
Ralf Ulrich's avatar
Ralf Ulrich committed
172 173 174
  except:
    refs:
      - master
Ralf Ulrich's avatar
Ralf Ulrich committed
175 176 177 178 179 180

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

Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
182 183 184 185 186
documentation:
  image: corsika/devel:u-18.04
  dependencies:
    - build-u-18_04
  stage: optional
Ralf Ulrich's avatar
Ralf Ulrich committed
187
  tags:
Lukas Nellen's avatar
Lukas Nellen committed
188
    - corsika
189
  script:
Ralf Ulrich's avatar
Ralf Ulrich committed
190
    - cd build
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
191
    - cmake --build . --target doxygen -- -j4
192 193
    - mkdir .public
    - cp -r Documentation/Doxygen/html .public/
Ralf Ulrich's avatar
Ralf Ulrich committed
194
    - mv .public ../public
195
  artifacts:
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
196
    expire_in: 3 months
197 198
    paths:
      - public
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
  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