IAP GITLAB

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

# normal pipeline for each commit
Ralf Ulrich's avatar
Ralf Ulrich committed
47
build-test-u-18_04: 
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
48 49 50
  image: corsika/devel:u-18.04
  dependencies:
    - config-u-18_04
51
  stage: build_test
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
52 53 54 55
  tags:
    - corsika
  script:
    - cd build
56
    - cmake --build . -- -j4
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
57 58 59
    - set -o pipefail
    - ctest -VV | gzip -v -9 > test.log.gz 
  artifacts:
60
    expire_in: 1 week
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
61 62 63
    reports:
      junit:
        - build/test_outputs/junit*.xml
64 65
    paths:
      - build/test.log.gz
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
66

67
# normal pipeline for each commit
Ralf Ulrich's avatar
Ralf Ulrich committed
68
build-test-clang-8: 
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
69 70
  image: corsika/devel:clang-8
  dependencies:
71 72
    - config-clang-8
  stage: build_test
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
73 74 75 76
  tags:
    - corsika
  script:
    - cd build
77 78
    - cmake --build . -- -j4
    - set -o pipefail
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
79 80
    - ctest -VV | gzip -v -9 > test.log.gz 
  artifacts:
81
    expire_in: 1 week
82 83 84
    reports:
      junit:
        - build/test_outputs/junit*.xml
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
85 86
    paths:
      - build/test.log.gz
87 88
 
# optional release pipeline for each commit
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
89 90 91 92 93
release-u-18_04: 
  image: corsika/devel:u-18.04
  dependencies:
    - config-u-18_04
  stage: optional
94 95 96
  tags:
    - corsika
  script:
97
    - cd build
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
98
    - cmake .. -DCMAKE_BUILD_TYPE=Release
99
    - cmake --build . -- -j4
100 101 102 103 104 105 106 107 108
    - 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
109 110
  when: manual    

111
# optional release pipeline for each commit
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
112 113 114 115 116 117 118 119 120 121 122
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
123 124 125 126 127 128 129 130 131
    - 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
132 133
  when: manual    

Ralf Ulrich's avatar
Ralf Ulrich committed
134 135
# 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
136 137 138 139 140 141 142 143 144 145 146 147 148
  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
149
  coverage: '/^.*functions\.+:\s(.*\%)\s/'
150
  artifacts:
151
    expire_in: 1 year
152
    paths:
153
      - build/coverage-report.tar.gz
Ralf Ulrich's avatar
Ralf Ulrich committed
154

Ralf Ulrich's avatar
Ralf Ulrich committed
155
coverage: # special manual job to run after normal pipeline on branch finished 
Ralf Ulrich's avatar
Ralf Ulrich committed
156
  <<: *coverage_job
Ralf Ulrich's avatar
CI  
Ralf Ulrich committed
157
  when: manual    
Ralf Ulrich's avatar
Ralf Ulrich committed
158 159 160
  except:
    refs:
      - master
Ralf Ulrich's avatar
Ralf Ulrich committed
161 162 163 164 165 166

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

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