-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
309 lines (274 loc) · 11.2 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
before_script:
- git submodule sync
- git submodule init
- git submodule update --recursive --init
- mkdir -p build && find build/ -name "*.h5" -delete
.job_template: &artifact_config
artifacts:
when: on_failure
paths:
- build/Testing/Temporary/*.log
expire_in: 1d
artifacts:
when: on_success
expire_in: 12h
paths:
- build/
rules:
- if: $CI_COMMIT_TAG
.job_template: &test_config
rules:
- if: $CI_COMMIT_TAG
stages:
- matlab
- octave
- build
- test
- misc
- release
include:
- '/matlab/ci.yaml'
- '/deploy/documentation.yaml'
ubuntu2004-gcc:
<<: *artifact_config
stage: build
image: gitlab.mpi-magdeburg.mpg.de/ci-images/minimal/ubuntu:focal
needs: []
script:
- apt-get update; apt-get install --yes cmake libopenblas-openmp-dev libhdf5-dev
- cmake --version
- mkdir -p build
- cd build
- cmake ../ -DDEBUG=ON -DEXAMPLES=ON
- make
test-ubuntu2004-gcc:
<<: *test_config
stage: test
image: gitlab.mpi-magdeburg.mpg.de/ci-images/minimal/ubuntu:focal
needs:
- ubuntu2004-gcc
script:
- apt-get update; apt-get install --yes cmake libopenblas-openmp-dev libhdf5-dev
- cd build
- OMP_NUM_THREADS=1 MEPACK_HDF_PATH=. ctest
artifacts:
when: on_failure
paths:
- build/Testing/Temporary/*.log
ubuntu2004-gcc-64bit:
<<: *artifact_config
stage: build
needs: []
image: gitlab.mpi-magdeburg.mpg.de/ci-images/minimal/ubuntu:focal
script:
- apt-get update; apt-get install --yes cmake libopenblas64-openmp-dev libhdf5-dev
- cmake --version
- mkdir -p build
- cd build
- cmake ../ -DDEBUG=ON -DEXAMPLES=ON -DINTEGER8=ON
- make
test-ubuntu2004-gcc-64bit:
<<: *test_config
stage: test
image: gitlab.mpi-magdeburg.mpg.de/ci-images/minimal/ubuntu:focal
needs:
- ubuntu2004-gcc-64bit
script:
- apt-get update; apt-get install --yes cmake libopenblas64-openmp-dev libhdf5-dev
- cd build
- OMP_NUM_THREADS=1 MEPACK_HDF_PATH=. ctest
artifacts:
when: on_failure
paths:
- build/Testing/Temporary/*.log
ubuntu2004-gcc-refblas:
<<: *artifact_config
stage: build
needs: []
image: gitlab.mpi-magdeburg.mpg.de/ci-images/minimal/ubuntu:focal
script:
- apt-get update; apt-get install --yes cmake libblas-dev liblapack-dev libhdf5-dev
- cmake --version
- mkdir -p build
- cd build
- cmake ../ -DDEBUG=ON -DEXAMPLES=ON
- make
test-ubuntu2004-gcc-refblas:
<<: *test_config
stage: test
image: gitlab.mpi-magdeburg.mpg.de/ci-images/minimal/ubuntu:focal
needs:
- ubuntu2004-gcc-refblas
script:
- apt-get update; apt-get install --yes cmake libblas-dev liblapack-dev libhdf5-dev
- cd build
- OMP_NUM_THREADS=1 MEPACK_HDF_PATH=. ctest
artifacts:
when: on_failure
paths:
- build/Testing/Temporary/*.log
ubuntu2004-gcc10:
<<: *artifact_config
stage: build
needs: []
image: gitlab.mpi-magdeburg.mpg.de/ci-images/minimal/ubuntu:focal
script:
- apt-get update; apt-get install --yes gcc-10 gfortran-10 g++-10 cmake libopenblas-openmp-dev libhdf5-dev
- cmake --version
- mkdir -p build
- cd build
- CC=gcc-10 CXX=g++-10 FC=gfortran-10 cmake ../ -DDEBUG=ON -DEXAMPLES=ON
- make
test-ubuntu2004-gcc10:
<<: *test_config
stage: test
image: gitlab.mpi-magdeburg.mpg.de/ci-images/minimal/ubuntu:focal
needs:
- ubuntu2004-gcc10
script:
- apt-get update; apt-get install --yes cmake libopenblas-openmp-dev libhdf5-dev
- cd build
- OMP_NUM_THREADS=2 MEPACK_HDF_PATH=. ctest
artifacts:
when: on_failure
paths:
- build/Testing/Temporary/*.log
ubuntu2204-gcc:
<<: *artifact_config
stage: build
needs: []
image: gitlab.mpi-magdeburg.mpg.de/ci-images/minimal/ubuntu:jammy
script:
- export
- apt-get update; apt-get install --yes cmake libopenblas-openmp-dev libhdf5-dev
- cmake --version
- mkdir -p build
- cd build
- cmake ../ -DDEBUG=ON -DEXAMPLES=ON
- make
test-ubuntu2204-gcc:
<<: *test_config
stage: test
image: gitlab.mpi-magdeburg.mpg.de/ci-images/minimal/ubuntu:jammy
needs:
- ubuntu2204-gcc
script:
- apt-get update; apt-get install --yes cmake libopenblas-openmp-dev libhdf5-dev
- cd build
- OMP_NUM_THREADS=1 MEPACK_HDF_PATH=. ctest
artifacts:
when: on_failure
paths:
- build/Testing/Temporary/*.log
ubuntu2204-gcc-64bit:
<<: *artifact_config
stage: build
needs: []
image: gitlab.mpi-magdeburg.mpg.de/ci-images/minimal/ubuntu:jammy
script:
- apt-get update; apt-get install --yes cmake libopenblas64-openmp-dev libhdf5-dev
- cmake --version
- mkdir -p build
- cd build
- cmake ../ -DDEBUG=ON -DEXAMPLES=ON -DINTEGER8=ON
- make
test-ubuntu2204-gcc-64bit:
<<: *test_config
stage: test
image: gitlab.mpi-magdeburg.mpg.de/ci-images/minimal/ubuntu:jammy
needs:
- ubuntu2204-gcc-64bit
script:
- apt-get update; apt-get install --yes cmake libopenblas64-openmp-dev libhdf5-dev
- cd build
- OMP_NUM_THREADS=1 MEPACK_HDF_PATH=. ctest
artifacts:
when: on_failure
paths:
- build/Testing/Temporary/*.log
ubuntu2204-gcc-coverage:
<<: *artifact_config
stage: build
needs: []
image: gitlab.mpi-magdeburg.mpg.de/ci-images/minimal/ubuntu:jammy
script:
- apt-get update; apt-get install --yes cmake libopenblas-openmp-dev libhdf5-dev lcov
- mkdir -p build
- cd build
- cmake ../ -DDEBUG=ON -DEXAMPLES=ON -DCOVERAGE=ON
- make
test-ubuntu2204-gcc-coverage:
<<: *test_config
stage: test
image: gitlab.mpi-magdeburg.mpg.de/ci-images/minimal/ubuntu:jammy
needs:
- ubuntu2204-gcc-coverage
script:
- apt-get update; apt-get install --yes cmake libopenblas-openmp-dev libhdf5-dev lcov
- cd build
- OMP_NUM_THREADS=1 MEPACK_HDF_PATH=. make coverage
coverage : '/\s+lines\.+:\s\d+\.\d\%\s\(\d+ of \d+ lines\)/'
artifacts:
when: always
paths:
- build/coverage/*
release-job:
rules:
- if: $CI_COMMIT_TAG
stage: release
image: gitlab.mpi-magdeburg.mpg.de/ci-images/minimal/ubuntu:jammy
needs:
- matlab-2020b
- matlab-2021a
- matlab-2022a
- matlab-2023b
- octave-4.4
- octave-5.1
- octave-5.2
- octave-6.1
- octave-6.2
- octave-6.3
- octave-6.4
- octave-7.1
- octave-7.2
- octave-7.3
- octave-8.1
- octave-8.2
- octave-8.3
- octave-8.4
- documentation
script:
- |
set -x
if [ -z "$CI_COMMIT_TAG" ]; then export CI_COMMIT_TAG=$(git describe) ; fi
export V=$(echo $CI_COMMIT_TAG | sed -e 's/^v//g')
apt install --yes xz-utils
(git ls-files --recurse-submodules | tar --transform="s|^|mepack-$V/|g" -cvzf ../mepack-$V.tar.gz -T- )
(git ls-files --recurse-submodules | tar --transform="s|^|mepack-$V/|g" -cvjf ../mepack-$V.tar.bz2 -T- )
(git ls-files --recurse-submodules | tar --transform="s|^|mepack-$V/|g" -cvJf ../mepack-$V.tar.xz -T- )
cd build
rm -f release.sh
echo -n "release-cli create --tag-name '$CI_COMMIT_TAG' --tag-message 'Version $CI_COMMIT_TAG' " >> release.sh
echo -n "--description 'Release for Version $CI_COMMIT_TAG' --name 'Release $CI_COMMIT_TAG' " >> release.sh
for i in "mepack-$V.tar.gz" "mepack-$V.tar.bz2" "mepack-$V.tar.xz"
do
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ../../${i} ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/mepack-source/${CI_COMMIT_TAG}/${i}
echo -n " --assets-link '{\"name\":\"${i}\",\"url\":\"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/mepack-source/${CI_COMMIT_TAG}/${i}\"}'" >> release.sh
done
for i in mepack*matlab*.tar.gz
do
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ${i} ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/mepack-matlab/${CI_COMMIT_TAG}/${i}
echo -n " --assets-link '{\"name\":\"${i}\",\"url\":\"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/mepack-matlab/${CI_COMMIT_TAG}/${i}\"}'" >> release.sh
done
for i in mepack*octave*.tar.gz
do
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ${i} ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/mepack-octave/${CI_COMMIT_TAG}/${i}
echo -n " --assets-link '{\"name\":\"${i}\",\"url\":\"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/mepack-octave/${CI_COMMIT_TAG}/${i}\"}'" >> release.sh
done
for i in mepack-*docs.tar.gz
do
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ${i} ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/mepack-docs/${CI_COMMIT_TAG}/${i}
echo -n " --assets-link '{\"name\":\"Documentation (HTML)\",\"url\":\"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/mepack-docs/${CI_COMMIT_TAG}/${i}\"}'" >> release.sh
done
cat release.sh
bash release.sh