.gitlab-ci.yml 5.2 KB
Newer Older
1
variables:
2
  RSYNC_OPTS: --recursive --ignore-missing-args --chown ${DEPLOY_USER}:${DEPLOY_USER}
3
4
5
  DOCKER_TAG: ${CI_COMMIT_REF_NAME}
  DOCKER_IMAGE: rwthacs/dpsim
  DOCKER_IMAGE_DEV: rwthacs/dpsim-dev
6
7

before_script:
Steffen Vogel's avatar
fix CI    
Steffen Vogel committed
8
  - git config --local core.longpaths true
9
  - git submodule sync --recursive
10
  - git submodule update --init --recursive
11

12
13
14
stages:
  - prepare
  - build
Steffen Vogel's avatar
Steffen Vogel committed
15
  - test
Markus Mirz's avatar
fix ci    
Markus Mirz committed
16
  - generate
Markus Mirz's avatar
Markus Mirz committed
17
  - deploy
18
19
20
21

docker:
  stage: prepare
  script:
22
23
    - docker build
        --file Packaging/Docker/Dockerfile.dev
Markus Mirz's avatar
Markus Mirz committed
24
        --tag ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
25
        --tag ${DOCKER_IMAGE_DEV}:latest .
Markus Mirz's avatar
Markus Mirz committed
26
# build dedicated jupyter image in the future
Steffen Vogel's avatar
Steffen Vogel committed
27
28
29
    - docker build
       --file Packaging/Docker/Dockerfile.jupyter
       --build-arg DOCKER_IMAGE=${DOCKER_IMAGE_DEV}
Markus Mirz's avatar
Markus Mirz committed
30
31
       --build-arg DOCKER_TAG=${DOCKER_TAG}
       --tag ${DOCKER_IMAGE_DEV}-jupyter:${DOCKER_TAG}
Steffen Vogel's avatar
Steffen Vogel committed
32
       --tag ${DOCKER_IMAGE_DEV}-jupyter:latest .
33
  tags:
Markus Mirz's avatar
Markus Mirz committed
34
    - shell
Steffen Vogel's avatar
Steffen Vogel committed
35
    - linux
36

Steffen Vogel's avatar
fix CI    
Steffen Vogel committed
37
build:linux:
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
  stage: build
  script:
    - mkdir -p build
    - cd build
    - cmake -DWITH_CUDA=OFF ..
    - make -j 32
  image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
  cache:
    paths:
      - build
    key: build-linux
  artifacts:
    paths:
      - build
  tags:
    - docker

build:linux-cuda:
Markus Mirz's avatar
Markus Mirz committed
56
  stage: build
57
  script:
58
    - mkdir -p build
Markus Mirz's avatar
Markus Mirz committed
59
    - cd build
60
    - cmake ..
Steffen Vogel's avatar
Steffen Vogel committed
61
    - make -j 32
Markus Mirz's avatar
Markus Mirz committed
62
  image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
63
64
65
  cache:
    paths:
      - build
66
    key: build-linux-cuda
67
68
  artifacts:
    paths:
Markus Mirz's avatar
Markus Mirz committed
69
      - build
70
  tags:
Georg Martin Reinke's avatar
Georg Martin Reinke committed
71
72
    - docker

Steffen Vogel's avatar
Steffen Vogel committed
73
74
75
build:windows:
  stage: build
  script:
Steffen Vogel's avatar
Steffen Vogel committed
76
77
    - New-Item -ItemType Directory -Force -Path build
    - Set-Location -Path build
78
79
80
    # 64 Bit Graphviz Builds for Windows:
    # https://ci.appveyor.com/project/ellson/graphviz-pl238/
    - cmake .. -DGraphviz_ROOT="C:/Program Files/Graphviz 2.41.20190716.1839"
81
    - cmake --build . -j 24
Steffen Vogel's avatar
Steffen Vogel committed
82
83
84
85
86
87
88
  tags:
    - win10
  cache:
    paths:
      - build
    key: build-win10

Markus Mirz's avatar
Markus Mirz committed
89
90
91
92
93
94
95
#build:macos:
#  stage: build
#  script:
#    - mkdir -p build
#    - cd build
#    - cmake -DCMAKE_C_COMPILER=/usr/local/bin/gcc-9
#            -DCMAKE_CXX_COMPILER=/usr/local/bin/g++-9
Markus Mirz's avatar
Markus Mirz committed
96
#            -DWITH_CIM_SUBMODULE=ON
Markus Mirz's avatar
Markus Mirz committed
97
98
99
100
101
102
103
104
105
106
107
#            -DWITH_SUNDIALS=OFF ..
#    - make -j $(sysctl -n hw.ncpu)
#  cache:
#    paths:
#      - build
#    key: build-macos
#  artifacts:
#    paths:
#      - build
#  tags:
#    - mac
Steffen Vogel's avatar
Steffen Vogel committed
108

Markus Mirz's avatar
Markus Mirz committed
109
110
111
112
113
114
115
116
117
118
119
120
121
#test:pytest:
#  stage: test
#  variables:
#    PYTHONPATH: "build/Source/Python:Source/Python"
#  script:
#    - pytest -v Examples/CIM/test_CIM.yml
#    - pytest -v Examples/Cxx/test_Circuits.yml
#    - pytest -v Examples/Cxx/test_RealTime.yml
#    #- pytest -v Examples/Cxx/test_Shmem.yml
#    - pytest -v Examples/Python/Base
#    - pytest -v Examples/Python/Circuits
#    - pytest -v Examples/Python/RealTime
#    #- pytest -v Examples/Python/Shmem
Markus Mirz's avatar
Markus Mirz committed
122
#  image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
Markus Mirz's avatar
Markus Mirz committed
123
124
125
126
#  dependencies:
#    - build:linux
#  tags:
#    - docker
Steffen Vogel's avatar
Steffen Vogel committed
127

Markus Mirz's avatar
fix ci    
Markus Mirz committed
128
129
generate:docs:
  stage: generate
Georg Martin Reinke's avatar
Georg Martin Reinke committed
130
  script:
Steffen Vogel's avatar
Steffen Vogel committed
131
132
    - make -j$(nproc) -C build docs
    - make -j$(nproc) -C build docs_cxx
Markus Mirz's avatar
Markus Mirz committed
133
  image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
Steffen Vogel's avatar
Steffen Vogel committed
134
  dependencies:
Steffen Vogel's avatar
fix CI    
Steffen Vogel committed
135
    - build:linux
Georg Martin Reinke's avatar
Georg Martin Reinke committed
136
137
  artifacts:
    paths:
Markus Mirz's avatar
Markus Mirz committed
138
139
      - build/docs/sphinx/html
      - build/docs/doxygen/html
Georg Martin Reinke's avatar
Georg Martin Reinke committed
140
141
  tags:
    - docker
142

Markus Mirz's avatar
fix ci    
Markus Mirz committed
143
144
generate:packages:
  stage: generate
Steffen Vogel's avatar
Steffen Vogel committed
145
  script:
Steffen Vogel's avatar
Steffen Vogel committed
146
    - make -j$(nproc) -C build package
Steffen Vogel's avatar
Steffen Vogel committed
147
148
149
150
  only:
    - tags
  tags:
    - docker
Markus Mirz's avatar
Markus Mirz committed
151
  image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
Steffen Vogel's avatar
Steffen Vogel committed
152
  dependencies:
Steffen Vogel's avatar
fix CI    
Steffen Vogel committed
153
    - build:linux
Steffen Vogel's avatar
Steffen Vogel committed
154
155
156
157
158
  artifacts:
    paths:
      - build/*.rpm
      - build/*.tar.gz

159
160
161
build:docker:
  stage: build
  script:
Markus Mirz's avatar
Markus Mirz committed
162
    - docker build
163
164
        --file Packaging/Docker/Dockerfile
        --build-arg DOCKER_TAG=${DOCKER_TAG}
165
166
167
168
        --build-arg CI=1
        --build-arg CI_COMMIT_SHA=${CI_COMMIT_SHA}
        --build-arg CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME}
        --build-arg CI_COMMIT_TAG=${CI_COMMIT_TAG}
169
170
        --tag ${DOCKER_IMAGE}:${DOCKER_TAG}
        --tag ${DOCKER_IMAGE}:latest .
171
172
  tags:
    - shell
Steffen Vogel's avatar
Steffen Vogel committed
173
    - linux
Markus Mirz's avatar
Markus Mirz committed
174
175
  only:
    - tags
176

Steffen Vogel's avatar
Steffen Vogel committed
177
test:jupyter:
178
179
180
181
182
  stage: test
  variables:
    PYTHONPATH: "build/Source/Python:Source/Python"
  script:
    - pytest -v Examples/Notebooks
Markus Mirz's avatar
Markus Mirz committed
183
  image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
184
185
186
187
188
189
190
  dependencies:
    - build:linux
  tags:
    - docker
  artifacts:
    paths:
      - outputs/Examples/Notebooks/
Steffen Vogel's avatar
Steffen Vogel committed
191

Markus Mirz's avatar
Markus Mirz committed
192
193
194
195
196
# Stage deploy
##############################################################################
pages:
  stage: deploy
  script:
Markus Mirz's avatar
Markus Mirz committed
197
198
    - cp -r build/docs/sphinx/html/. public/sphinx
    - cp -r build/docs/doxygen/html/. public/doxygen
Markus Mirz's avatar
Markus Mirz committed
199
200
201
202
203
204
  artifacts:
    paths:
      - public
  dependencies:
    - generate:docs
  only:
205
    - deploy
Markus Mirz's avatar
Markus Mirz committed
206
207
208
209
  tags:
    - shell
    - linux

Markus Mirz's avatar
Markus Mirz committed
210
deploy:docker:
211
212
  stage: deploy
  script:
Markus Mirz's avatar
Markus Mirz committed
213
    - docker push ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
214
    - docker push ${DOCKER_IMAGE_DEV}:latest
215
    - docker push ${DOCKER_IMAGE}:${DOCKER_TAG}
216
    - docker push ${DOCKER_IMAGE}:latest
217
218
219
220
  dependencies:
    - build:docker
  tags:
    - shell
Steffen Vogel's avatar
Steffen Vogel committed
221
    - linux
Steffen Vogel's avatar
Steffen Vogel committed
222
223
  only:
    - tags
224

Steffen Vogel's avatar
Steffen Vogel committed
225
226
227
deploy:packages:
  stage: deploy
  script:
Markus Mirz's avatar
Markus Mirz committed
228
    - rsync ${RSYNC_OPTS} build/*.rpm ${DEPLOY_USER}@${DEPLOY_HOST}:/var/www/packages/fedora/29/x86_64
Steffen Vogel's avatar
Steffen Vogel committed
229
    - rsync ${RSYNC_OPTS} build/*.tar.gz ${DEPLOY_USER}@${DEPLOY_HOST}:/var/www/dpsim/src
Markus Mirz's avatar
Markus Mirz committed
230
    - ssh ${DEPLOY_USER}@${DEPLOY_HOST} createrepo /var/www/packages/fedora/29
Steffen Vogel's avatar
Steffen Vogel committed
231
  dependencies:
Markus Mirz's avatar
fix ci    
Markus Mirz committed
232
    - generate:packages
Steffen Vogel's avatar
Steffen Vogel committed
233
234
235
236
237
  only:
    - tags
  tags:
    - fein-deploy
    - shell
238
    - linux