forked from telekom/sysrepo-plugin-interfaces
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
97 lines (84 loc) · 2.59 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
image: "debian:sid"
before_script:
- apt-get update
- apt-get -y install clang cmake libcmocka0 libcmocka-dev valgrind libnl-3-200 libnl-3-dev libnl-genl-3-dev libnl-nf-3-dev
# prepare for building debian packages
- apt-get -y install git build-essential fakeroot devscripts
# TODO: when libyang2 is available in Debian unstable
- git clone --depth=1 https://github.com/jpetrina/libyang -b debian/v2.0.7 && cd libyang
- mk-build-deps --install --tool 'apt-get --yes --no-install-recommends' --remove
- dpkg-buildpackage -j$(nproc) --build=binary --root-command=fakeroot --unsigned-source --unsigned-changes
- (dpkg -i ../libyang2*.deb || apt-get -y install -f) && cd ..
# TODO: when libyang2 is available in Debian unstable
- git clone --depth=1 https://github.com/jpetrina/sysrepo -b debian/v2.0.1 && cd sysrepo
- mk-build-deps --install --tool 'apt-get --yes --no-install-recommends' --remove
- dpkg-buildpackage -j$(nproc) --build=binary --root-command=fakeroot --unsigned-source --unsigned-changes
- (dpkg -i ../sysrepo*.deb ../libsysrepo*.deb || apt-get -y install -f) && cd ..
# resolve time issues
- ln -snf /usr/share/zoneinfo/Europe/Zagreb /etc/localtime && echo 'Europe/Zagreb' > /etc/timezone
stages:
- build
- test
build:default:
stage: build
script:
- mkdir build && cd build
- CC=clang cmake -DENABLE_BUILD_TESTS=ON ..
- make
artifacts:
paths:
- build/
build:sanitized:
stage: build
script:
- mkdir build_sanitized && cd build_sanitized
- CC=clang cmake -DCMAKE_C_FLAGS=\"-fsanitize=address,undefined\" -DENABLE_SANITIZER=ON ..
- make
artifacts:
paths:
- build_sanitized/
build:sanitized_memory:
stage: build
script:
- mkdir build_sanitized_memory && cd build_sanitized_memory
- CC=clang cmake -DCMAKE_C_FLAGS=\"-fsanitize=memory\" -DENABLE_SANITIZER=ON ..
- make
artifacts:
paths:
- build_sanitized_memory/
test:default:
stage: test
needs: ["build:default"]
script:
- cd build
- ctest -T test --output-on-failure
artifacts:
paths:
- build/
test:sanitized:
stage: test
needs: ["build:sanitized"]
script:
- cd build_sanitized
- ctest -T test --output-on-failure
artifacts:
paths:
- build_sanitized/
test:sanitized_memory:
stage: test
needs: ["build:sanitized_memory"]
script:
- cd build_sanitized_memory
- ctest -T test --output-on-failure
artifacts:
paths:
- build_sanitized_memory/
test:valgrind:
stage: test
needs: ["build:default"]
script:
- cd build
- ctest -T memcheck
artifacts:
paths:
- build/