-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
138 lines (115 loc) · 4.63 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
stages:
- check
- build
# -----------------------------------------------------------------------------
# Check Build
# -----------------------------------------------------------------------------
check:
image: debian:9
stage: check
script:
- sed -i 's/deb.debian.org/mirror.yandex.ru/' /etc/apt/sources.list
- sed -i 's/security.debian.org/mirror.yandex.ru/' /etc/apt/sources.list
- apt update -y && apt install -y cmake clang clang-tidy git make cppcheck
- mkdir reports
- cmake -DCMAKE_C_COMPILER=/usr/lib/llvm-3.8/libexec/ccc-analyzer -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS_DEBUG="-Wall -Wextra -pedantic -std=c99 -D__linux__" -DCMAKE_EXPORT_COMPILE_COMMANDS=1 .
- cppcheck --enable=all --project=compile_commands.json 1>/dev/null 2>reports/cppcheck
- find -name '*.[ch]' | xargs clang-tidy -checks=-clang-diagnostic-unused-parameter 1>reports/clang-tidy
- scan-build -o reports make -j $(cat /proc/cpuinfo | grep processor | wc -l) > /dev/null
- cat reports/cppcheck
- cat reports/clang-tidy
tags:
- docker
artifacts:
paths:
- reports
expire_in: 1 day
x86_64-linux:
image: debian:9
stage: build
script:
- sed -i 's/deb.debian.org/mirror.yandex.ru/' /etc/apt/sources.list
- sed -i 's/security.debian.org/mirror.yandex.ru/' /etc/apt/sources.list
- apt update -y && apt install -y ninja-build cmake git gcc
- mkdir build
- cd build
- cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_RELEASE="-O3 -DNDEBUG -Wall -Wextra -pedantic -Werror -Wno-unused-parameter -std=c99" ..
- ninja
- ninja test
tags:
- docker
x86_64-linux-memsan:
image: debian:9
stage: build
script:
- sed -i 's/deb.debian.org/mirror.yandex.ru/' /etc/apt/sources.list
- sed -i 's/security.debian.org/mirror.yandex.ru/' /etc/apt/sources.list
- apt update -y && apt install -y ninja-build cmake git gcc
- mkdir build
- cd build
- cmake -G "Ninja" -DCMAKE_C_FLAGS="-g -O0 -fsanitize=leak -fsanitize=address" ..
- ninja
- ninja test
tags:
- docker
x86_64-linux-valgrind:
image: debian:9
stage: build
script:
- sed -i 's/deb.debian.org/mirror.yandex.ru/' /etc/apt/sources.list
- sed -i 's/security.debian.org/mirror.yandex.ru/' /etc/apt/sources.list
- apt update -y && apt install -y ninja-build cmake git gcc valgrind
- mkdir build
- cd build
- cmake -G "Ninja" -DCMAKE_C_FLAGS="-g -O0" ..
- ninja
- find -executable -type f -name 'unit_*' -exec valgrind '{}' \;
tags:
- docker
x86_64-linux-coverage:
image: debian:9
stage: build
script:
- sed -i 's/deb.debian.org/mirror.yandex.ru/' /etc/apt/sources.list
- sed -i 's/security.debian.org/mirror.yandex.ru/' /etc/apt/sources.list
- apt update -y && apt install -y ninja-build cmake git gcc gcovr
- mkdir build
- cd build
- cmake -G "Ninja" -DTEKON_TESTS_COVERAGE=1 ..
- ninja
- ninja test
- ../test/suite_msr.sh $(pwd)
- ../test/suite_arch.sh $(pwd)
- ../test/suite_sync.sh $(pwd)
- gcov $(find -name '*gcno')
- gcovr -r $(pwd)/.. --exclude-directories test --exclude-directories tekon/test --exclude-directories utils/test -s
tags:
- docker
armhf-linux:
image: debian:9
stage: build
script:
- sed -i 's/deb.debian.org/mirror.yandex.ru/' /etc/apt/sources.list
- sed -i 's/security.debian.org/mirror.yandex.ru/' /etc/apt/sources.list
- apt update -y && apt install -y ninja-build cmake git gcc-arm-linux-gnueabihf qemu
- mkdir build
- cd build
- cmake -G "Ninja" -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_RELEASE="-O3 -DNDEBUG -Wall -Wextra -Wno-unused-parameter -std=c99" ..
- ninja
- find -executable -type f -name 'unit_*' -exec qemu-arm -L /usr/arm-linux-gnueabihf '{}' \;
tags:
- docker
x86_64-mingw:
image: debian:9
stage: build
script:
- sed -i 's/deb.debian.org/mirror.yandex.ru/' /etc/apt/sources.list
- sed -i 's/security.debian.org/mirror.yandex.ru/' /etc/apt/sources.list
- apt update && apt install -y ninja-build cmake git gcc-mingw-w64-x86-64 build-essential autoconf automake libtool wine
- mkdir build
- cd build
- cmake -G "Ninja" -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_LINKER=/usr/x86_64-w64-mingw32/bin/ld -DCMAKE_C_STANDARD_LIBRARIES="-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -lws2_32 -liphlpapi -lpsapi -luserenv" -DCMAKE_EXE_LINKER_FLAGS="-Wl,-Bstatic -lwinpthread" ..
- ninja
- find -executable -type f -name 'unit_*' -exec wine '{}' \;
tags:
- docker