-
Notifications
You must be signed in to change notification settings - Fork 70
/
.gitlab-ci.yml
173 lines (162 loc) · 6.36 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
image: debian:stable-slim
stages:
- build
- test
before_script:
- test ! -r /etc/debian_version || apt-get -qq update
- test ! -r /etc/debian_version || apt-get install -y git debhelper dpkg-dev build-essential fakeroot flawfinder wget unzip
- test ! -r /etc/debian_version || apt-get install -y libpcap-dev libselinux1-dev
- test ! -r /etc/debian_version || apt-get install -y binutils-mingw-w64-i686 gcc-mingw-w64 mingw-w64-i686-dev binutils-mingw-w64-x86-64 mingw-w64-x86-64-dev mingw-w64-common clang
- test ! -r /etc/debian_version || apt-get install -y valgrind sudo netcat-openbsd
- test ! -r /etc/debian_version || apt-get install -y autoconf automake dh-autoreconf
- test ! -r /etc/arch-release || pacman -Syu --noconfirm
- test ! -r /etc/arch-release || pacman -S --noconfirm binutils gcc base-devel git
- test ! -r /etc/arch-release || pacman -S --noconfirm valgrind sudo
- mkdir -p ./deploy/gcc ./deploy/i686-w64-mingw32-winpcap ./deploy/i686-w64-mingw32-npcap ./deploy/clang ./deploy/android28-clang
build:
script:
- autoreconf -fi
- ./configure --enable-option-checking=fatal --prefix=/
- mv config.log deploy/config-default.log
- make install CFLAGS='-Werror' DESTDIR="$(realpath ./deploy/gcc)" V=s
- make dist
- cp ptunnel-ng-*.tar.gz ./deploy/
stage: build
artifacts:
paths:
- deploy/
when: always
build-sanitizer-asserts:
script:
- autoreconf -fi
- ./configure --enable-option-checking=fatal --prefix=/ --enable-sanitizer --enable-asserts
- mv config.log deploy/config-sanitizer-assert.log
- make install CFLAGS='-Werror' DESTDIR="$(realpath ./deploy/gcc-sanitizer-asserts)" V=s
stage: build
artifacts:
paths:
- deploy/
when: always
build-debian:
script:
- dpkg-buildpackage -b -us -uc
- mv config.log deploy/config-debian.log
- ls -alh ..
- mkdir -p deploy/debian
- mv -v ../ptunnel-ng-dbgsym_* ../ptunnel-ng_* deploy/debian/
stage: build
artifacts:
paths:
- deploy/
when: always
build-archlinux:
image: archlinux/base
script:
- useradd builduser -m
- passwd -d builduser
- chown -R builduser .
- su -m builduser bash -c 'makepkg'
- su -m builduser bash -c 'makepkg -p PKGBUILD.dev --skipchecksums'
- ls -alh .
- mkdir deploy/archlinux
- mv -v ptunnel-ng-*.pkg.tar.zst deploy/archlinux/
stage: build
artifacts:
paths:
- deploy/
when: always
build-mingw:
script:
# print mingw-gcc versions and check if the required define is set
- i686-w64-mingw32-gcc --version
- i686-w64-mingw32-gcc -dM -E - < /dev/null | grep -E '^#define WIN32 1$'
- x86_64-w64-mingw32-gcc --version
- x86_64-w64-mingw32-gcc -dM -E - < /dev/null | grep -E '^#define WIN32 1$'
# the actual build
- autoreconf -fi
# i686-w64-mingw32
- ./configure --enable-option-checking=fatal --prefix=/ --host=i686-w64-mingw32
- mv config.log deploy/config-mingw-i686.log
- make install CFLAGS='-Werror' DESTDIR="$(realpath ./deploy/i686-w64-mingw32-winpcap)" V=s
- make clean
- ./configure --enable-option-checking=fatal --prefix=/ --host=i686-w64-mingw32 --enable-npcap
- mv config.log deploy/config-mingw-i686-npcap.log
- make install CFLAGS='-Werror' DESTDIR="$(realpath ./deploy/i686-w64-mingw32-npcap)" V=s
- make clean
# x86-64-w64-mingw32
- ./configure --enable-option-checking=fatal --prefix=/ --host=x86_64-w64-mingw32
- mv config.log deploy/config-mingw-x86_64.log
- make install CFLAGS='-Werror' DESTDIR="$(realpath ./deploy/x86_64-w64-mingw32-winpcap)" V=s
- make clean
- ./configure --enable-option-checking=fatal --prefix=/ --host=x86_64-w64-mingw32 --enable-npcap
- mv config.log deploy/config-mingw-x86_64-npcap.log
- make install CFLAGS='-Werror' DESTDIR="$(realpath ./deploy/x86_64-w64-mingw32-npcap)" V=s
- make clean
stage: build
artifacts:
paths:
- deploy/
when: always
build-clang:
script:
- autoreconf -fi
- CC=clang ./configure --enable-option-checking=fatal --prefix=/
- mv config.log deploy/config-clang.log
- make install CFLAGS='-Werror' DESTDIR="$(realpath ./deploy/clang)" V=s
stage: build
artifacts:
paths:
- deploy/
when: always
build-android:
cache:
key: toolchain-cache
paths:
- vendor/
script:
- mkdir -p vendor && cd vendor
- test -r 'android-ndk-r19-linux-x86_64.zip' || wget --progress=dot:mega 'https://dl.google.com/android/repository/android-ndk-r19-linux-x86_64.zip'
- test -d 'android-ndk-r19' || unzip -q 'android-ndk-r19-linux-x86_64.zip'
- cd ..
- autoreconf -fi
- CC=aarch64-linux-android28-clang PATH="${PATH}:$(realpath ./vendor/android-ndk-r19/toolchains/llvm/prebuilt/linux-x86_64/bin)" ./configure --enable-option-checking=fatal --host=aarch64-linux-android
- mv config.log deploy/config-aarch64-linux-android28-clang.log
- PATH="${PATH}:$(realpath ./vendor/android-ndk-r19/toolchains/llvm/prebuilt/linux-x86_64/bin)" make install CFLAGS='-Werror' DESTDIR="$(realpath ./deploy/android28-clang)" V=s
stage: build
artifacts:
paths:
- deploy/
when: always
test-valgrind:
script:
- ls -alhR .
- deploy/gcc/bin/ptunnel-ng --help
- PTUNNEL_BIN="deploy/gcc/bin/ptunnel-ng" test/integration_test.sh
- mv /tmp/ptunnel-client.log ptunnel-client-valgrind.log
- mv /tmp/ptunnel-server.log ptunnel-server-valgrind.log
stage: test
artifacts:
paths:
- deploy/
- ptunnel-client-valgrind.log
- ptunnel-server-valgrind.log
when: always
test-asan:
script:
- ls -alhR .
- deploy/gcc-sanitizer-asserts/bin/ptunnel-ng --help
- export DISABLE_VALGRIND=y && export PTUNNEL_BIN="deploy/gcc-sanitizer-asserts/bin/ptunnel-ng" && test/integration_test.sh
- mv /tmp/ptunnel-client.log ptunnel-client-sanitizer.log
- mv /tmp/ptunnel-server.log ptunnel-server-sanitizer.log
- export DISABLE_VALGRIND=y && export PTUNNEL_BIN="deploy/gcc-sanitizer-asserts/bin/ptunnel-ng" && export PTUNNEL_ARGS="--passwd=ci" && test/integration_test.sh
- mv /tmp/ptunnel-client.log ptunnel-client-sanitizer-passwd.log
- mv /tmp/ptunnel-server.log ptunnel-server-sanitizer-passwd.log
stage: test
artifacts:
paths:
- deploy/
- ptunnel-client-sanitizer.log
- ptunnel-server-sanitizer.log
- ptunnel-client-sanitizer-passwd.log
- ptunnel-server-sanitizer-passwd.log
when: always