Skip to content

Commit 9035410

Browse files
committed
Updated GH Unix build configurations
- Added support to build 32-bit versions of libModSecurity on Linux - Added support to build libModSecurity using clang on Linux (both 64-bit and 32-bit versions) - Fixed macOS dependencies to include yajl, not only because it is a required dependency, but because tests were not being run on macOS builds without it. - Added build without libxml to Linux & macOS configurations. - Added build without ssdeep to Linux configurations (already in macOS configuration) - Removed 'without yajl' build because it's a required 3rd party dependency. - Added bison & flex dependencies to enable parser generation.
1 parent 108c0d3 commit 9035410

File tree

1 file changed

+71
-22
lines changed

1 file changed

+71
-22
lines changed

.github/workflows/ci.yml

Lines changed: 71 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,64 +6,111 @@ on:
66

77
jobs:
88
build-linux:
9+
name: Linux (${{ matrix.platform.label }}, ${{ matrix.compiler.label }}, ${{ matrix.configure.label }})
910
runs-on: ${{ matrix.os }}
1011
strategy:
1112
matrix:
1213
os: [ubuntu-22.04]
13-
platform: [x32, x64]
14-
compiler: [gcc, clang]
14+
platform:
15+
- {label: "x64", arch: "amd64", configure: ""}
16+
- {label: "x32", arch: "i386", configure: "PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32"}
17+
compiler:
18+
- {label: "gcc", cc: "gcc", cxx: "g++"}
19+
- {label: "clang", cc: "clang", cxx: "clang++"}
1520
configure:
1621
- {label: "with parser generation", opt: "--enable-parser-generation" }
1722
- {label: "wo curl", opt: "--without-curl" }
18-
- {label: "wo yajl", opt: "--without-yajl" }
19-
- {label: "wo geoip", opt: "--without-geoip" }
2023
- {label: "wo lmdb", opt: "--without-lmdb" }
21-
- {label: "with pcre2", opt: "--with-pcre2" }
2224
- {label: "wo lua", opt: "--without-lua" }
23-
- {label: "without maxmind", opt: "--without-maxmind" }
25+
- {label: "wo maxmind", opt: "--without-maxmind" }
26+
- {label: "wo libxml", opt: "--without-libxml" }
27+
- {label: "wo geoip", opt: "--without-geoip" }
28+
- {label: "wo ssdeep", opt: "--without-ssdeep" }
29+
- {label: "with pcre2", opt: "--with-pcre2" }
30+
exclude:
31+
- platform: {label: "x32"}
32+
configure: {label: "wo geoip"}
33+
- platform: {label: "x32"}
34+
configure: {label: "wo ssdeep"}
2435
steps:
25-
- name: Setup Dependencies
36+
- name: Setup Dependencies (common)
2637
run: |
38+
sudo dpkg --add-architecture ${{ matrix.platform.arch }}
2739
sudo apt-get update -y -qq
28-
sudo apt-get install -y libfuzzy-dev libyajl-dev libgeoip-dev liblua5.2-dev liblmdb-dev libmaxminddb-dev libcurl4-openssl-dev libpcre2-dev pcre2-utils
40+
sudo apt-get install -y libyajl-dev:${{ matrix.platform.arch }} \
41+
libcurl4-openssl-dev:${{ matrix.platform.arch }} \
42+
liblmdb-dev:${{ matrix.platform.arch }} \
43+
liblua5.2-dev:${{ matrix.platform.arch }} \
44+
libmaxminddb-dev:${{ matrix.platform.arch }} \
45+
libpcre2-dev:${{ matrix.platform.arch }} \
46+
pcre2-utils:${{ matrix.platform.arch }} \
47+
bison flex
48+
- name: Setup Dependencies (x32)
49+
if: ${{ matrix.platform.label == 'x32' }}
50+
run: |
51+
sudo apt-get install g++-multilib
52+
sudo apt-get install -y libxml2-dev:${{ matrix.platform.arch }} \
53+
libpcre3-dev:${{ matrix.platform.arch }}
54+
- name: Setup Dependencies (x64)
55+
if: ${{ matrix.platform.label == 'x64' }}
56+
run: |
57+
sudo apt-get install -y libgeoip-dev:${{ matrix.platform.arch }} \
58+
libfuzzy-dev:${{ matrix.platform.arch }}
2959
- uses: actions/checkout@v4
3060
with:
3161
submodules: true
3262
- name: build.sh
3363
run: ./build.sh
34-
- name: configure ${{ matrix.configure.label }}
35-
run: ./configure ${{ matrix.configure.opt }}
64+
- name: configure
65+
env:
66+
CC: ${{ matrix.compiler.cc }}
67+
CXX: ${{ matrix.compiler.cxx }}
68+
run: ./configure ${{ matrix.platform.configure }} ${{ matrix.configure.opt }}
3669
- uses: ammaraskar/gcc-problem-matcher@master
3770
- name: make
3871
run: make -j `nproc`
3972
- name: check
4073
run: make check
4174

4275
build-macos:
76+
name: macOS (${{ matrix.configure.label }})
4377
runs-on: ${{ matrix.os }}
4478
strategy:
4579
matrix:
4680
os: [macos-12]
47-
compiler: [clang]
4881
configure:
4982
- {label: "with parser generation", opt: "--enable-parser-generation" }
5083
- {label: "wo curl", opt: "--without-curl" }
51-
- {label: "wo yajl", opt: "--without-yajl" }
52-
- {label: "wo geoip", opt: "--without-geoip" }
5384
- {label: "wo lmdb", opt: "--without-lmdb" }
54-
- {label: "wo ssdeep", opt: "--without-ssdeep" }
5585
- {label: "wo lua", opt: "--without-lua" }
5686
- {label: "wo maxmind", opt: "--without-maxmind" }
87+
- {label: "wo libxml", opt: "--without-libxml" }
88+
- {label: "wo geoip", opt: "--without-geoip" }
89+
- {label: "wo ssdeep", opt: "--without-ssdeep" }
90+
- {label: "with pcre2", opt: "--with-pcre2" }
5791
steps:
5892
- name: Setup Dependencies
5993
run: |
60-
brew install autoconf automake cppcheck lmdb libyaml lua ssdeep libmaxminddb bison
94+
brew install autoconf \
95+
automake \
96+
yajl \
97+
curl \
98+
lmdb \
99+
lua \
100+
libmaxminddb \
101+
libxml2 \
102+
geoip \
103+
ssdeep \
104+
pcre \
105+
pcre2 \
106+
bison \
107+
flex
61108
- uses: actions/checkout@v4
62109
with:
63110
submodules: true
64111
- name: build.sh
65112
run: ./build.sh
66-
- name: configure ${{ matrix.configure.label }}
113+
- name: configure
67114
run: ./configure ${{ matrix.configure.opt }}
68115
- uses: ammaraskar/gcc-problem-matcher@master
69116
- name: make
@@ -72,19 +119,21 @@ jobs:
72119
run: make check
73120

74121
build-windows:
122+
name: Windows (${{ matrix.platform.label }}, ${{ matrix.configure.label }})
75123
runs-on: ${{ matrix.os }}
76124
strategy:
77125
matrix:
78126
os: [windows-2022]
79-
platform: [x86_64]
127+
platform:
128+
- {label: "x64", arch: "x86_64"}
80129
configuration: [Release]
81130
configure:
82131
- {label: "full", opt: "" }
132+
- {label: "wo curl", opt: "-DWITHOUT_CURL=ON" }
83133
- {label: "wo lmdb", opt: "-DWITHOUT_LMDB=ON" }
84134
- {label: "wo lua", opt: "-DWITHOUT_LUA=ON" }
85-
- {label: "wo libxml2", opt: "-WITHOUT_LIBXML2=ON" }
86135
- {label: "wo maxmind", opt: "-DWITHOUT_MAXMIND=ON" }
87-
- {label: "wo curl", opt: "-DWITHOUT_CURL=ON" }
136+
- {label: "wo libxml", opt: "-WITHOUT_LIBXML2=ON" }
88137
steps:
89138
- uses: actions/checkout@v4
90139
with:
@@ -94,9 +143,9 @@ jobs:
94143
pip3 install conan --upgrade
95144
conan profile detect
96145
- uses: ammaraskar/msvc-problem-matcher@master
97-
- name: Build ${{ matrix.configuration }} ${{ matrix.platform }} ${{ matrix.configure.label }}
146+
- name: Build ${{ matrix.configuration }} ${{ matrix.platform.arch }} ${{ matrix.configure.label }}
98147
shell: cmd
99-
run: vcbuild.bat ${{ matrix.configuration }} ${{ matrix.platform }} NO_ASAN "${{ matrix.configure.opt }}"
148+
run: vcbuild.bat ${{ matrix.configuration }} ${{ matrix.platform.arch }} NO_ASAN "${{ matrix.configure.opt }}"
100149
- name: Set up test environment
101150
working-directory: build\win32\build\${{ matrix.configuration }}
102151
env:
@@ -140,4 +189,4 @@ jobs:
140189
./build.sh
141190
./configure
142191
- name: Run cppcheck on libModSecurity
143-
run: make check-static
192+
run: make check-static

0 commit comments

Comments
 (0)