-
Notifications
You must be signed in to change notification settings - Fork 15
278 lines (270 loc) · 8.81 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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
name: CI
on:
push:
branches:
- '*'
paths-ignore:
- '.gitignore'
- '**.md'
- 'LICENSE'
pull_request:
branches:
- '*'
paths-ignore:
- '.gitignore'
- '**.md'
- 'LICENSE'
jobs:
cmake-fedora-latest:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler: [ gcc, clang ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: mod_proxy_cluster
- name: Setup Podman
run: |
sudo apt update
sudo apt-get -y install podman
- name: Create container and build
run: |
{
echo 'FROM fedora:40'
echo 'RUN dnf install cmake httpd-devel ${{ matrix.compiler }} -y'
echo 'RUN dnf groupinstall "C Development Tools and Libraries" -y'
echo 'RUN dnf clean all'
echo 'COPY mod_proxy_cluster mod_proxy_cluster'
echo 'WORKDIR /mod_proxy_cluster/native'
echo 'RUN cmake . -DCMAKE_C_COMPILER=${{ matrix.compiler }}'
echo 'RUN make'
} > podmanfile
podman build -f ./podmanfile
name: cmake-fedora-latest
make-fedora-latest:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: mod_proxy_cluster
- name: Setup Podman
run: |
sudo apt update
sudo apt-get -y install podman
- name: Create container and build
run: |
{
echo 'FROM fedora:40'
echo 'RUN dnf install httpd-devel redhat-rpm-config -y'
echo 'RUN dnf groupinstall "C Development Tools and Libraries" -y'
echo 'RUN dnf clean all'
echo 'COPY mod_proxy_cluster mod_proxy_cluster'
echo 'WORKDIR /mod_proxy_cluster/native'
echo 'RUN \'
echo 'for module in advertise/ mod_proxy_cluster/ balancers/ mod_manager; do \'
echo ' echo Building: $module; \'
echo ' cd $module; \'
echo ' sh buildconf; \'
echo ' ./configure --with-apxs=$APACHE_DIR/bin/apxs; \'
echo ' make clean; \'
# Ensure the build fails in case of a failure in any of the module builds!
echo ' make || exit 1; \'
echo ' cd ..; \'
echo 'done;'
} > podmanfile
podman build -f ./podmanfile
clang-format-style-check:
# The ubuntu-latest has an old version of clang-format, let's use ubuntu-24.04 which is in Beta
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: mod_proxy_cluster
- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y clang-format
- name: Check styles
run: |
code=0
cd mod_proxy_cluster/native
for file in */*.c */*.h; do
clang-format $file -n &> diff.txt;
if [ ! -s diff.txt ]; then
printf "%-42s ... OK\n" $file
else
cat diff.txt
printf "%-42s ... NOK\n" $file
code=1
fi
rm diff.txt || true # we don't fail if the file does not exist
done;
exit $code
make-httpd-maintainer-mode:
runs-on: ubuntu-latest
container:
image: quay.io/mod_cluster/ci-httpd-dev
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: |
cd native
for module in advertise/ mod_proxy_cluster/ balancers/ mod_manager/; do \
cd $module; \
sh buildconf; \
./configure CFLAGS="-Wall -Werror" --with-apxs=/usr/local/apache2/bin/apxs; \
make clean; \
make || exit 1; \
cd ..; \
done;
make-with-httpd-trunk:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: mod_proxy_cluster
- name: Checkout latest httpd
uses: actions/checkout@v4
with:
repository: apache/httpd
path: httpd
- name: Checkout apr for httpd
uses: actions/checkout@v4
with:
repository: apache/apr
path: httpd/srclib/apr
- name: Install necessary packages
run: |
ls
sudo apt-get update
sudo apt-get install cmake gcc cmake gcc make libtool libtool-bin python3 autoconf libxml2-dev libpcre2-dev -y
- name: Build httpd
run: |
ls
export "APACHE_DIR=/usr/local/apache2/"
cd httpd
./buildconf
./configure --prefix=/usr/local/apache2 --with-included-apr --enable-proxy-ajp --enable-maintainer-mode \
--enable-so --enable-proxy --enable-proxy-http --enable-proxy-wstunned --enable-proxy-hcheck \
--with-port=8000
sudo make
sudo make install
- name: Build mod_proxy_cluster
run: |
ls
cd mod_proxy_cluster/native
for module in advertise/ mod_proxy_cluster/ balancers/ mod_manager/; do \
cd $module; \
sh buildconf; \
./configure CFLAGS="-Wall -Werror" --with-apxs=/usr/local/apache2/bin/apxs; \
make clean; \
make || exit 1; \
cd ..; \
done;
cmake-windows-latest:
runs-on: windows-latest
env:
APACHE_LOUNGE_DISTRO_VERSION: 2.4.62-240904
HTTPD_DEV_HOME: 'C:\Apache24'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Developer Command Prompt for Microsoft Visual C++
uses: ilammy/msvc-dev-cmd@v1
- name: Get httpd
run: |
curl.exe --output "httpd-apache-lounge.zip" --url "https://www.apachelounge.com/download/VS17/binaries/httpd-${{ env.APACHE_LOUNGE_DISTRO_VERSION }}-win64-VS17.zip"
Expand-Archive -Path "httpd-apache-lounge.zip" -DestinationPath "C:\"
- name: Build
run: |
./native/scripts/windows-build.bat
cp cmakebuild/modules/*.so C:/Apache24/modules/
- name: Fix and prepare config files
run: |
cp test\httpd\mod_proxy_cluster.conf ${{ env.HTTPD_DEV_HOME }}\conf\mod_proxy_cluster.conf
echo "LogLevel debug" >> ${{ env.HTTPD_DEV_HOME }}\conf\mod_proxy_cluster.conf
echo "Include conf/mod_proxy_cluster.conf" >> ${{ env.HTTPD_DEV_HOME }}\conf\httpd.conf
(Get-Content ${{ env.HTTPD_DEV_HOME }}\conf\httpd.conf) | %{$_ -replace "Listen 80","Listen 8000"} | Set-Content -Path ${{ env.HTTPD_DEV_HOME }}\conf\httpd.conf
- name: Run
run: |
Start-Process -FilePath ${{ env.HTTPD_DEV_HOME }}\bin\httpd.exe
curl --fail --max-time 10 http://localhost:8000
curl --fail --max-time 10 http://localhost:6666/mod_cluster_manager
- name: Preserve logs
uses: actions/upload-artifact@v4
if: always()
with:
name: Windows logs
path: C:\Apache24\logs\
retention-days: 7
tests:
runs-on: ubuntu-latest
env:
IMG: local-tomcat
HTTPD_IMG: local-httpd
DEBUG: on
FOREVER_PAUSE: 100
ITERATION_COUNT: 2
TOMCAT_CYCLE_COUNT: 2
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Stop Mono and XSP
# These occupy port 8084 unnecessarily
run: |
sudo systemctl stop mono-xsp4.service || true
sudo systemctl disable mono-xsp4.service || true
sudo killall mono || true
sudo killall xsp4 || true
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Setup dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y docker maven git curl iproute2
cd test
sh setup-dependencies.sh
- name: Print network environment
run: ss -ltp
- name: Run testsuite
run: |
cd test
sh testsuite.sh
- name: Preserve test logs
uses: actions/upload-artifact@v4
if: always()
with:
name: Test logs
path: |
test/logs/*
retention-days: 7
doxygen:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get doxygen
run: |
sudo apt-get update -y
sudo apt-get install -y doxygen
- name: Build doxygen docs
run: doxygen
- name: Preserve doxygen docs
uses: actions/upload-artifact@v4
with:
name: Doxygen docs
path: doxygen-out/html/*
retention-days: 30