forked from owasp-modsecurity/ModSecurity
-
Notifications
You must be signed in to change notification settings - Fork 0
272 lines (226 loc) · 8.59 KB
/
ci_new.yml
File metadata and controls
272 lines (226 loc) · 8.59 KB
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
name: Quality Assurance new
on:
push:
pull_request:
env:
LUA_VERSION: "5.4"
jobs:
build-linux:
name: Linux (${{ matrix.platform.label }}, ${{ matrix.compiler.label }}, ${{ matrix.configure.label }})
# Ubuntu 24.04 does not provide native 32-bit (i386) installation images.
# Only amd64 (x86_64) is officially supported. 32-bit has been removed from this matrix.
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
platform:
- { label: "x64", arch: "amd64", configure: "" }
compiler:
- { label: "gcc", cc: "gcc", cxx: "g++" }
- { label: "clang", cc: "clang", cxx: "clang++" }
configure:
- { label: "with parser generation", opt: "--enable-parser-generation" }
- { label: "without curl", opt: "--without-curl" }
- { label: "without lua", opt: "--without-lua" }
- { label: "without maxmind", opt: "--without-maxmind" }
- { label: "without libxml", opt: "--without-libxml" }
- { label: "without geoip", opt: "--without-geoip" }
- { label: "without ssdeep", opt: "--without-ssdeep" }
- { label: "with lmdb", opt: "--with-lmdb" }
- { label: "with pcre2 (default)", opt: "" }
- { label: "with pcre", opt: "--with-pcre" }
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update -y -qq
sudo apt-get install -y \
libyajl-dev \
libcurl4-openssl-dev \
liblmdb-dev \
liblua${{ env.LUA_VERSION }}-dev \
libmaxminddb-dev \
libpcre2-dev \
libxml2-dev \
libfuzzy-dev \
pcre2-utils \
libpcre3-dev \
bison \
flex \
pkg-config
- name: Run build preparation script
run: ./build.sh
- name: Configure
env:
CC: ${{ matrix.compiler.cc }}
CXX: ${{ matrix.compiler.cxx }}
run: ./configure ${{ matrix.platform.configure }} ${{ matrix.configure.opt }} --enable-assertions=yes
- uses: ammaraskar/gcc-problem-matcher@master
- name: Compile
run: make -j "$(nproc)"
- name: Run tests
run: make check
build-macos:
name: macOS (${{ matrix.configure.label }})
runs-on: macos-15
strategy:
fail-fast: false
matrix:
configure:
- { label: "with parser generation", opt: "--enable-parser-generation" }
- { label: "without curl", opt: "--without-curl" }
- { label: "without lua", opt: "--without-lua" }
- { label: "without maxmind", opt: "--without-maxmind" }
- { label: "without libxml", opt: "--without-libxml" }
- { label: "without geoip", opt: "--without-geoip" }
- { label: "without ssdeep", opt: "--without-ssdeep" }
- { label: "with lmdb", opt: "--with-lmdb" }
- { label: "with pcre2 (default)", opt: "" }
- { label: "with pcre", opt: "--with-pcre" }
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Install dependencies
# curl and pcre2 are typically already available in the macOS runner image
run: |
brew install autoconf \
automake \
libtool \
yajl \
lmdb \
lua@${{ env.LUA_VERSION }} \
libmaxminddb \
libxml2 \
ssdeep \
pcre \
bison \
flex
echo "/usr/local/opt/lua@${{ env.LUA_VERSION }}/bin" >> $GITHUB_PATH
- name: Run build preparation script
run: ./build.sh
- name: Configure
run: ./configure ${{ matrix.configure.opt }} --enable-assertions=yes
- uses: ammaraskar/gcc-problem-matcher@master
- name: Compile
run: make -j "$(sysctl -n hw.logicalcpu)"
- name: Run tests
run: make check
build-windows:
name: Windows (${{ matrix.platform.label }}, ${{ matrix.configure.label }})
runs-on: windows-2025
strategy:
fail-fast: false
matrix:
platform:
- { label: "x64", arch: "x86_64" }
configuration: [Release]
configure:
- { label: "full", opt: "" }
- { label: "without curl", opt: "-DWITH_CURL=OFF" }
- { label: "without lua", opt: "-DWITH_LUA=OFF" }
- { label: "without maxmind", opt: "-DWITH_MAXMIND=OFF" }
- { label: "without libxml", opt: "-DWITH_LIBXML2=OFF" }
- { label: "with lmdb", opt: "-DWITH_LMDB=ON" }
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Install Conan package manager
run: |
pip3 install conan --upgrade
conan profile detect
- uses: ammaraskar/msvc-problem-matcher@master
- name: Build project
shell: cmd
run: vcbuild.bat ${{ matrix.configuration }} ${{ matrix.platform.arch }} NO_ASAN "${{ matrix.configure.opt }}"
- name: Prepare test environment
working-directory: build\win32\build\${{ matrix.configuration }}
env:
BASE_DIR: ..\..\..\..
shell: cmd
run: |
copy unit_tests.exe %BASE_DIR%\test
copy regression_tests.exe %BASE_DIR%\test
copy libModSecurity.dll %BASE_DIR%\test
copy %BASE_DIR%\unicode.mapping %BASE_DIR%\test
md \tmp
md \bin
copy "C:\Program Files\Git\usr\bin\echo.exe" \bin
copy "C:\Program Files\Git\usr\bin\echo.exe" \bin\echo
- name: Disable unsupported tests on Windows
working-directory: test\test-cases\regression
shell: cmd
run: |
jq "map(if .title == \"Test match variable (1/n)\" then .enabled = 0 else . end)" issue-2423-msg-in-chain.json > tmp.json && move /Y tmp.json issue-2423-msg-in-chain.json
jq "map(if .title == \"Test match variable (2/n)\" then .enabled = 0 else . end)" issue-2423-msg-in-chain.json > tmp.json && move /Y tmp.json issue-2423-msg-in-chain.json
jq "map(if .title == \"Test match variable (3/n)\" then .enabled = 0 else . end)" issue-2423-msg-in-chain.json > tmp.json && move /Y tmp.json issue-2423-msg-in-chain.json
jq "map(if .title == \"Variable offset - FILES_NAMES\" then .enabled = 0 else . end)" offset-variable.json > tmp.json && move /Y tmp.json offset-variable.json
- name: Run tests
working-directory: build\win32\build
run: ctest -C ${{ matrix.configuration }} --output-on-failure
cppcheck:
name: Static analysis (cppcheck)
runs-on: macos-15
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Install cppcheck
run: |
brew install autoconf automake libtool cppcheck libmaxminddb yajl lua@${{ env.LUA_VERSION }} lmdb ssdeep
echo "/usr/local/opt/lua@${{ env.LUA_VERSION }}/bin" >> $GITHUB_PATH
- name: Configure project
run: |
./build.sh
./configure
- name: Run cppcheck
run: make check-static
cppcheck-linux:
name: Static analysis (cppcheck, Linux, debian:sid)
runs-on: ubuntu-latest
container: debian:sid
steps:
- name: Install basic tools
run: |
apt-get update
apt-get install -y git
- name: Mark repo as safe for git
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Install dependencies (v2 style)
run: |
apt-get update
apt-get install -y \
autoconf \
automake \
build-essential \
libtool \
pkg-config \
cppcheck \
libyajl-dev \
libcurl4-openssl-dev \
liblmdb-dev \
liblua${{ env.LUA_VERSION }}-dev \
libmaxminddb-dev \
libpcre2-dev \
libxml2-dev \
libfuzzy-dev \
pcre2-utils \
bison \
flex
- name: Run build preparation script
run: ./build.sh
- name: Configure project
run: ./configure
- name: Run cppcheck
run: make check-static