-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
165 lines (153 loc) · 5.02 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
stages:
- lint
- build
- test
- package
- package-install
variables:
GIT_SUBMODULE_STRATEGY: recursive
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
DEBIAN_FRONTEND: noninteractive
.before_script_template:
before_script:
- apt-get update -qq
- apt-get install -y git gpg wget
- git submodule update --init --recursive
.before_script_template_lint:
before_script:
- dnf update -y
- dnf install dnf-plugins-core -y
- dnf config-manager --set-enabled powertools
- dnf install -y cmake gcc-toolset-11 gtest gtest-devel
lint:cppcheck:
extends: .before_script_template_lint
stage: lint
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'
image: rockylinux:8
script:
- dnf install -y cppcheck
- cppcheck --std=c++17
--language=c++
--error-exitcode=1
--enable=all
--suppress=unmatchedSuppression
--suppress=missingIncludeSystem
--suppress=unusedFunction
src/*.cpp src/*/*.h bin/*.cpp src/*/*.tpp
lint:clang-format:
extends: .before_script_template_lint
stage: lint
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'
image: rockylinux:8
script:
- dnf install -y clang-tools-extra
- clang-format --style=file -i src/*.cpp src/*/*.h src/*/*.tpp
lint:cpplint:
extends: .before_script_template_lint
stage: lint
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'
image: rockylinux:8
script:
- dnf install -y python3 python3-pip
- pip3 install cpplint
- cpplint --filter=-readability/fn_size,-whitespace/indent,-whitespace/comments src/*.cpp src/*/*.h bin/*.cpp src/*/*.tpp
build:ubuntu:
extends: .before_script_template
stage: build
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'
image: ubuntu:22.04
script:
- apt-get install -y cmake make gcc g++ libopenmpi-dev libhdf5-dev libhdf5-openmpi-dev libssl-dev nlohmann-json3-dev
- mkdir build
- cd build
- cmake -DPLIHDF5_USE_LINTING=OFF ..
- make
artifacts:
paths:
- build/
expire_in: 20 minutes
package:ubuntu22.04:
extends: .before_script_template
stage: package
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'
image: ubuntu:22.04
script:
- apt-get install -y cmake make gcc g++ libopenmpi-dev libhdf5-dev libhdf5-openmpi-dev libssl-dev nlohmann-json3-dev dpkg-dev lsb-release
- if [ -d "build" ]; then rm -r build; fi
- mkdir build
- cd build
- cmake -DBUILD_TESTING=OFF -DPLIHDF5_USE_LINTING=OFF ..
- make
- cpack
artifacts:
paths:
- build/
expire_in: 1 week
package:ubuntu20.04:
extends: .before_script_template
stage: package
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'
image: ubuntu:20.04
script:
- wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
- echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null
- apt-get update
- apt-get install -y cmake make gcc g++ libopenmpi-dev libhdf5-dev libhdf5-openmpi-dev libssl-dev nlohmann-json3-dev dpkg-dev lsb-release
- if [ -d "build" ]; then rm -r build; fi
- mkdir build
- cd build
- cmake -DBUILD_TESTING=OFF -DPLIHDF5_USE_LINTING=OFF ..
- make
- cpack
artifacts:
paths:
- build/
expire_in: 1 week
package-install:ubuntu20.04:
extends: .before_script_template
stage: package-install
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'
image: ubuntu:20.04
dependencies:
- package:ubuntu20.04
script:
- apt-get update -qq
- apt-get install -y ./build/plihdf5_*_amd64-*.deb
package-install:ubuntu22.04:
extends: .before_script_template
stage: package-install
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'
image: ubuntu:22.04
dependencies:
- package:ubuntu22.04
script:
- apt-get update -qq
- apt-get install -y ./build/plihdf5_*_amd64-*.deb
test:ubuntu:
extends: .before_script_template
stage: test
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'
image: ubuntu:22.04
script:
- apt-get install -y cmake make gcc g++ libopenmpi-dev libhdf5-dev libhdf5-openmpi-dev libssl-dev nlohmann-json3-dev
- if [ -d "build" ]; then rm -r build; fi
- mkdir build
- cd build
- cmake -DBUILD_TESTING=ON -DPLIHDF5_USE_LINTING=OFF ..
- make
- ctest --output-on-failure
dependencies:
- build:ubuntu
tags:
- docker
- gpu