.gitlab-ci.yml 8.37 KB
Newer Older
Michael Kuron's avatar
Michael Kuron committed
1
image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/ubuntu:18.04
Kai Szuttor's avatar
Kai Szuttor committed
2 3

stages:
4
  - permission
5
  - prepare
Kai Szuttor's avatar
Kai Szuttor committed
6
  - build
7
  - additional_checks
Kai Szuttor's avatar
Kai Szuttor committed
8
  - deploy
9
  - result
Kai Szuttor's avatar
Kai Szuttor committed
10

Kai Szuttor's avatar
Kai Szuttor committed
11
variables:
12
  GIT_SUBMODULE_STRATEGY: recursive
13
  CCACHE_DIR: /cache
Kai Szuttor's avatar
Kai Szuttor committed
14
  CCACHE_MAXSIZE: 100G
Kai Szuttor's avatar
Kai Szuttor committed
15
  with_ccache: "true"
Kai Szuttor's avatar
Kai Szuttor committed
16

17 18 19 20
check_permission:
  stage: permission
  only:
    - /.*external.*/
Kai Szuttor's avatar
Kai Szuttor committed
21
  when: manual
Kai Szuttor's avatar
Kai Szuttor committed
22
  allow_failure: false
23
  script:
Kai Szuttor's avatar
Kai Szuttor committed
24
    - exit 0
25 26
  tags:
    - linux
27

28 29 30
status_pending:
  stage: prepare
  script: bash maintainer/gh_post_status.sh pending
31 32
  tags:
    - linux
33

34
style:
35
  stage: prepare
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
  image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/clang:6.0
  dependencies: []
  before_script:
    - git submodule deinit .
  script:
    - maintainer/CI/fix_style.sh
    - git --no-pager diff > style.patch
    - git diff-index --quiet HEAD -- || (echo "Failed style check. Download $CI_JOB_URL/artifacts/raw/style.patch to see which changes are necessary." && exit 1)
    - echo "Passed style check"
  tags:
    - docker
    - linux
  variables:
    GIT_SUBMODULE_STRATEGY: none
  artifacts:
    paths:
    - style.patch
    expire_in: 1 week
    when: on_failure

Michael Kuron's avatar
Michael Kuron committed
56 57 58
### Builds without CUDA

default:
Kai Szuttor's avatar
Kai Szuttor committed
59
  stage: build
60
  script:
Michael Kuron's avatar
Michael Kuron committed
61
    - export with_cuda=false myconfig=default with_coverage=true
62
    - bash maintainer/CI/build_cmake.sh
63 64 65
  tags:
    - docker
    - linux
66

Michael Kuron's avatar
Michael Kuron committed
67
maxset:
Kai Szuttor's avatar
Kai Szuttor committed
68
  stage: build
69
  script:
Michael Kuron's avatar
Michael Kuron committed
70
    - export with_cuda=false myconfig=maxset with_coverage=true
71
    - bash maintainer/CI/build_cmake.sh
72 73 74
  tags:
    - docker
    - linux
75

76
maxset-python3:
Kai Szuttor's avatar
Kai Szuttor committed
77
  stage: build
78
  image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/ubuntu-python3:18.04
79
  script:
80
    - export myconfig=maxset with_coverage=true python_version=3
81
    - bash maintainer/CI/build_cmake.sh
82 83 84
  tags:
    - docker
    - linux
85

Michael Kuron's avatar
Michael Kuron committed
86
nocheckmaxset:
Kai Szuttor's avatar
Kai Szuttor committed
87
  stage: build
88
  script:
89
    - export with_cuda=false myconfig=nocheck-maxset make_check=false
90
    - bash maintainer/CI/build_cmake.sh
91 92 93
  tags:
    - docker
    - linux
94

Michael Kuron's avatar
Michael Kuron committed
95 96 97 98 99
### Builds with different Distributions

#debian:8 removed: similar to ubuntu:1404

debian:9:
Kai Szuttor's avatar
Kai Szuttor committed
100
  stage: build
Michael Kuron's avatar
Michael Kuron committed
101
  image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/$CI_JOB_NAME
102
  script:
Kai Szuttor's avatar
Kai Szuttor committed
103
    - export with_cuda=false
104
    - export myconfig=maxset make_check=false
105
    - bash maintainer/CI/build_cmake.sh
106 107 108
  tags:
    - docker
    - linux
109

Michael Kuron's avatar
Michael Kuron committed
110
opensuse:42.3:
Kai Szuttor's avatar
Kai Szuttor committed
111
  stage: build
Michael Kuron's avatar
Michael Kuron committed
112
  image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/$CI_JOB_NAME
Kai Szuttor's avatar
Kai Szuttor committed
113
  script:
Michael Kuron's avatar
Michael Kuron committed
114
    - export with_cuda=false myconfig=maxset make_check=false
115
    - bash maintainer/CI/build_cmake.sh
116 117 118
  tags:
    - docker
    - linux
119

Michael Kuron's avatar
Michael Kuron committed
120
opensuse:15.0:
Kai Szuttor's avatar
Kai Szuttor committed
121
  stage: build
Michael Kuron's avatar
Michael Kuron committed
122
  image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/$CI_JOB_NAME
123
  script:
Michael Kuron's avatar
Michael Kuron committed
124 125
    - export with_cuda=false myconfig=maxset make_check=false
    - bash maintainer/CI/build_cmake.sh
126 127 128
  tags:
    - docker
    - linux
Michael Kuron's avatar
Michael Kuron committed
129 130 131 132 133 134

centos:7:
  stage: build
  image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/$CI_JOB_NAME
  script:
    - export with_cuda=false myconfig=maxset make_check=false
135
    - bash maintainer/CI/build_cmake.sh
136 137 138
  tags:
    - docker
    - linux
139

Michael Kuron's avatar
Michael Kuron committed
140
fedora:
141
  stage: build
Michael Kuron's avatar
Michael Kuron committed
142
  image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/centos:next
143
  script:
Michael Kuron's avatar
Michael Kuron committed
144 145
    - export with_cuda=false myconfig=maxset make_check=false
    - bash maintainer/CI/build_cmake.sh
146 147 148
  tags:
    - docker
    - linux
Michael Kuron's avatar
Michael Kuron committed
149 150 151 152 153 154 155 156 157 158

#ubuntu:1404 not needed: used in cuda:8.0
#ubuntu:1604 not needed: used in cuda:9.0
#ubuntu:1804 not needed: default used in non-CUDA builds

### Builds with CUDA

cuda-shanchen:
  stage: build
  image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/cuda:9.0
159
  script:
160
    - export myconfig=shanchen python_version=3 make_check=false
161
    - bash maintainer/cuda_build.sh
162 163 164 165
  tags:
    - docker
    - linux
    - cuda
166

Michael Kuron's avatar
Michael Kuron committed
167
cuda-maxset:
168
  stage: build
Michael Kuron's avatar
Michael Kuron committed
169
  image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/cuda:9.0
170
  script:
171
    - export myconfig=maxset with_coverage=true python_version=3
172
    - bash maintainer/cuda_build.sh
Kai Szuttor's avatar
Kai Szuttor committed
173 174 175
  artifacts:
    paths:
    - build/
Michael Kuron's avatar
Michael Kuron committed
176
    expire_in: 1 week
177 178 179 180
  tags:
    - docker
    - linux
    - cuda
Michael Kuron's avatar
Michael Kuron committed
181 182

cuda8-maxset:
183
  stage: build
Michael Kuron's avatar
Michael Kuron committed
184
  image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/cuda:8.0
185
  script:
186
    - export myconfig=maxset with_coverage=true
187
    - bash maintainer/cuda_build.sh
Kai Szuttor's avatar
Kai Szuttor committed
188 189 190
  artifacts:
    paths:
    - build/
191
    expire_in: 1 week
192 193 194 195
  tags:
    - docker
    - linux
    - cuda
196

197 198
empty:
  stage: build
Michael Kuron's avatar
Michael Kuron committed
199
  image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/cuda:9.0
200
  script:
201
    - export myconfig=empty python_version=3
202
    - bash maintainer/CI/build_cmake.sh
203 204 205 206
  tags:
    - docker
    - linux
    - cuda
207

208 209 210 211 212 213 214 215 216 217
ubuntu:wo-dependencies:
  stage: build
  image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/$CI_JOB_NAME
  script:
    - export myconfig=maxset make_check=false
    - bash maintainer/CI/build_cmake.sh
  tags:
    - docker
    - linux

Michael Kuron's avatar
Michael Kuron committed
218 219 220 221 222 223
### Builds with ROCm

rocm-maxset:
  stage: build
  image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/rocm:latest
  script:
Michael Kuron's avatar
Michael Kuron committed
224
    - export myconfig=maxset
Michael Kuron's avatar
Michael Kuron committed
225 226
    - bash maintainer/CI/build_cmake.sh
  tags:
Michael Kuron's avatar
Michael Kuron committed
227
    - amdgpu
Michael Kuron's avatar
Michael Kuron committed
228

Michael Kuron's avatar
Michael Kuron committed
229 230
### Builds with OS X

231
osx:
Kai Szuttor's avatar
Kai Szuttor committed
232 233
  stage: build
  script:
234
    - export with_ccache=false myconfig=maxset with_cuda=false
235
    - bash maintainer/CI/build_cmake.sh
Kai Szuttor's avatar
Kai Szuttor committed
236 237 238
  tags:
    - mac

239
osx-python3:
240 241
  stage: build
  script:
242
    - export with_ccache=false myconfig=maxset with_cuda=false python_version=3
243
    - bash maintainer/CI/build_cmake.sh
244 245 246 247 248 249
  tags:
    - mac

osx-cuda:
  stage: build
  script:
250
    - export with_ccache=false myconfig=maxset with_cuda=true make_check=false
251
    - bash maintainer/CI/build_cmake.sh
252 253 254
  tags:
    - mac

Michael Kuron's avatar
Michael Kuron committed
255 256 257
### Builds with different compilers

clang:6.0:
258
  stage: build
Michael Kuron's avatar
Michael Kuron committed
259
  image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/$CI_JOB_NAME
260
  script:
261
    - export myconfig=maxset with_coverage=false with_static_analysis=true with_asan=true with_ubsan=true
262
    - bash maintainer/cuda_build.sh
263 264 265 266 267
  tags:
    - docker
    - linux
    - cuda
    - ptrace
268

Michael Kuron's avatar
Michael Kuron committed
269
intel:15:
270
  stage: build
Michael Kuron's avatar
Michael Kuron committed
271
  image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/$CI_JOB_NAME
272
  script:
273
    - export myconfig=maxset with_coverage=false I_MPI_SHM_LMT=shm
274
    - bash maintainer/cuda_build.sh
275 276 277 278
  tags:
    - docker
    - linux
    - cuda
279 280

intel:17:
281
  stage: build
282
  image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/$CI_JOB_NAME
283
  script:
284
    - export myconfig=maxset with_coverage=false I_MPI_SHM_LMT=shm
285
    - export cxx_flags=-O2
286
    - bash maintainer/cuda_build.sh
287 288 289 290
  tags:
    - docker
    - linux
    - cuda
291

292
check_sphinx:
293
  stage: additional_checks
294
  image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/cuda:8.0
295
  dependencies:
296
  - cuda8-maxset
297 298 299
  when: on_success
  script:
    - cd ${CI_PROJECT_DIR}; cd build && find ./ -exec touch -c -t 203901010000 {} \; && make sphinx
300 301 302 303
  tags:
    - docker
    - linux
    - cuda
304

305
check_with_odd_no_of_processors:
Kai Szuttor's avatar
Kai Szuttor committed
306
  stage: additional_checks
Michael Kuron's avatar
Michael Kuron committed
307
  image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/cuda:9.0
308 309
  when: on_success
  dependencies:
Michael Kuron's avatar
Michael Kuron committed
310
  - cuda-maxset
311
  script:
312
    - export myconfig=maxset with_coverage=true python_version=3 build_procs=3 check_procs=3 check_odd_only=true
313
    - bash maintainer/cuda_build.sh
314 315 316 317
  tags:
    - docker
    - linux
    - cuda
318

319
deploy_documentation:
320
  stage: deploy
321
  image: gitlab.icp.uni-stuttgart.de:4567/espressomd/docker/cuda:8.0
322
  only:
323
    - python
324 325
  dependencies:
    - cuda8-maxset
326 327 328 329
  before_script:
    - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
    - eval $(ssh-agent -s)
    - ssh-add <(echo "$SSH_PRIVATE_KEY")
330 331 332
    - mkdir -p ${HOME}/.ssh && chmod 700 ${HOME}/.ssh
    - echo "$SSH_PRIVATE_KEY" > ${HOME}/.ssh/espresso_rsa && chmod 600 ${HOME}/.ssh/espresso_rsa
    - echo "$SSH_PUBLIC_KEY" > ${HOME}/.ssh/espresso_rsa.pub && chmod 600 ${HOME}/.ssh/espresso_rsa.pub
333 334
    - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
  script:
335
    - cd ${CI_PROJECT_DIR}/build && find ./ -exec touch -c -t 203901010000 {} \; && make sphinx && make doxygen && cd doc/sphinx/html &&
336
      rsync -avz --delete -e "ssh -i ${HOME}/.ssh/espresso_rsa" ./* espresso@elk.icp.uni-stuttgart.de:/home/espresso/public_html/html/doc
337
    - cd ../../doxygen/html &&
338
      rsync -avz --delete -e "ssh -i ${HOME}/.ssh/espresso_rsa" ./* espresso@elk.icp.uni-stuttgart.de:/home/espresso/public_html/html/dox
339 340 341 342
  tags:
    - docker
    - linux
    - cuda
343 344 345 346 347

status_success:
  stage: result
  script: bash maintainer/gh_post_status.sh success
  when: on_success
348 349
  tags:
    - linux
350
  dependencies: []
351 352 353 354 355

status_failure:
  stage: result
  script: bash maintainer/gh_post_status.sh failure
  when: on_failure
356 357
  tags:
    - linux
358
  dependencies: []