-
Notifications
You must be signed in to change notification settings - Fork 16
238 lines (234 loc) · 8.77 KB
/
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
name: build
on: [pull_request]
jobs:
build-ubuntu-20-04:
name: ubuntu-20.04
runs-on: ubuntu-latest
container:
image: ubuntu:20.04
env:
TZ: America/New_York
DEBIAN_FRONTEND: noninteractive
services:
nginx:
image: nginx:stable
haproxy:
image: jbaldwindh/liblifthttp-automation-haproxy:0.1
steps:
- name: Checkout
uses: actions/checkout@v2
- name: apt
run: |
apt-get update
apt-get -y upgrade
apt install -y build-essential software-properties-common
add-apt-repository ppa:ubuntu-toolchain-r/test
apt-get install -y \
cmake \
git \
ninja-build \
g++-9 \
clang-9 \
zlib1g-dev \
libcurl4-openssl-dev \
libuv1-dev \
curl
- name: check-haproxy
run: |
curl -v --user guest:guestpassword -x "http://haproxy:3128" "http://nginx/index.html"
- name: build-release-g++
run: |
mkdir build-release-g++
cd build-release-g++
cmake \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=gcc-9 \
-DCMAKE_CXX_COMPILER=g++-9 \
..
ninja
- name: build-release-clang
run: |
mkdir build-release-clang
cd build-release-clang
cmake \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang-9 \
-DCMAKE_CXX_COMPILER=clang++-9 \
..
ninja
- name: test-release-g++
run: |
cd build-release-g++
ctest -VV
- name: test-release-clang
run: |
cd build-release-clang
ctest -VV
build-ubuntu-22-04:
name: ubuntu-22.04
runs-on: ubuntu-latest
container:
image: ubuntu:22.04
env:
TZ: America/New_York
DEBIAN_FRONTEND: noninteractive
services:
nginx:
image: nginx:stable
haproxy:
image: jbaldwindh/liblifthttp-automation-haproxy:0.1
steps:
- name: Checkout
uses: actions/checkout@v2
- name: apt
run: |
apt-get update
apt-get -y upgrade
apt install -y build-essential software-properties-common
apt-get install -y \
cmake \
git \
ninja-build \
g++ \
clang \
zlib1g-dev \
libssl-dev \
libuv1-dev \
curl \
wget
- name: check-haproxy
run: |
curl --user guest:guestpassword -x "http://haproxy:3128" "http://nginx/index.html"
- name: build-libcurl
run: |
# We have to custom build libcurl because ubuntu 22.02 default comes with a broken
# libcurl verison 7.81.0 that has a mutli interface segfault.
# See:
# https://github.com/jbaldwin/liblifthttp/issues/142
wget https://github.com/curl/curl/releases/download/curl-7_86_0/curl-7.86.0.tar.gz
gunzip curl-7.86.0.tar.gz
tar -xf curl-7.86.0.tar
cd curl-7.86.0/
./configure --with-openssl
make -j $(nproc)
make install
- name: build-release-g++
run: |
mkdir build-release-g++
cd build-release-g++
cmake \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DLIFT_USER_LINK_LIBRARIES="/usr/local/lib/libcurl.so.4;z;uv;pthread;dl;stdc++fs" \
..
ninja
- name: build-release-clang
run: |
mkdir build-release-clang
cd build-release-clang
cmake \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DLIFT_USER_LINK_LIBRARIES="/usr/local/lib/libcurl.so.4;z;uv;pthread;dl;stdc++fs" \
..
ninja
- name: test-release-g++
run: |
cd build-release-g++
ctest -VV
- name: test-release-clang
run: |
cd build-release-clang
ctest -VV
build-fedora-31:
name: fedora-31
runs-on: ubuntu-latest
container:
image: fedora:31
services:
nginx:
image: nginx:stable
haproxy:
image: jbaldwindh/liblifthttp-automation-haproxy:0.1
steps:
- name: Checkout
uses: actions/checkout@v2
- name: dnf
run: |
sudo dnf install -y \
cmake \
git \
ninja-build \
gcc-c++-9.3.1 \
clang-9.0.1 \
lcov \
zlib-devel \
libcurl-devel \
libuv-devel \
iputils \
curl
- name: ping
run: |
ping -c1 nginx
- name: check-haproxy
run: |
curl -v --user guest:guestpassword -x "http://haproxy:3128" "http://nginx/index.html"
- name: build-debug-g++
run: |
mkdir build-debug-g++
cd build-debug-g++
cmake \
-GNinja \
-DLIFT_CODE_COVERAGE=ON \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
..
ninja
- name: build-release-g++
run: |
mkdir build-release-g++
cd build-release-g++
cmake \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
..
ninja
- name: build-release-clang
run: |
mkdir build-release-clang
cd build-release-clang
cmake \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
..
ninja
- name: test-release-g++
run: |
cd build-release-g++
ctest -VV
- name: test-release-clang
run: |
cd build-release-clang
ctest -VV
- name: Build coverage info
run: |
cd build-debug-g++
ctest -VV
gcov -o ./test/CMakeFiles/liblifthttp_tests.dir/main.cpp.o ./test/liblifthttp_tests
lcov --include "*/inc/lift/*" --include "*/src/*" --exclude "test/*" -o liblifthttp_tests.info -c -d .
- name: Coveralls GitHub Action
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: build-debug-g++/liblifthttp_tests.info