Skip to content

Commit 85b9b0e

Browse files
committed
Create ci_new.yml
1 parent 5ed6c9e commit 85b9b0e

1 file changed

Lines changed: 236 additions & 0 deletions

File tree

.github/workflows/ci_new.yml

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
name: Quality Assurance new
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
build-linux:
9+
name: Linux (${{ matrix.platform.label }}, ${{ matrix.compiler.label }}, ${{ matrix.configure.label }})
10+
11+
# Ubuntu 24.04 does not provide native 32-bit (i386) installation images.
12+
# Only amd64 (x86_64) is officially supported. 32-bit has been removed from this matrix.
13+
runs-on: ubuntu-24.04
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
platform:
19+
- { label: "x64", arch: "amd64", configure: "" }
20+
21+
compiler:
22+
- { label: "gcc", cc: "gcc", cxx: "g++" }
23+
- { label: "clang", cc: "clang", cxx: "clang++" }
24+
25+
configure:
26+
- { label: "with parser generation", opt: "--enable-parser-generation" }
27+
- { label: "without curl", opt: "--without-curl" }
28+
- { label: "without lua", opt: "--without-lua" }
29+
- { label: "without maxmind", opt: "--without-maxmind" }
30+
- { label: "without libxml", opt: "--without-libxml" }
31+
- { label: "without geoip", opt: "--without-geoip" }
32+
- { label: "without ssdeep", opt: "--without-ssdeep" }
33+
- { label: "with lmdb", opt: "--with-lmdb" }
34+
- { label: "with pcre", opt: "--with-pcre" }
35+
36+
steps:
37+
- uses: actions/checkout@v6
38+
with:
39+
fetch-depth: 0
40+
submodules: true
41+
42+
- name: Ensure submodules are fully initialized (recursive)
43+
run: git submodule update --init --recursive
44+
45+
- name: Install dependencies
46+
run: |
47+
sudo apt-get update -y -qq
48+
sudo apt-get install -y \
49+
libyajl-dev \
50+
libcurl4-openssl-dev \
51+
liblmdb-dev \
52+
liblua5.2-dev \
53+
libmaxminddb-dev \
54+
libpcre2-dev \
55+
libgeoip-dev \
56+
libxml2-dev \
57+
libfuzzy-dev \
58+
pcre2-utils \
59+
bison \
60+
flex
61+
62+
- name: Run build preparation script
63+
run: ./build.sh
64+
65+
- name: Configure
66+
env:
67+
CC: ${{ matrix.compiler.cc }}
68+
CXX: ${{ matrix.compiler.cxx }}
69+
run: ./configure ${{ matrix.platform.configure }} ${{ matrix.configure.opt }} --enable-assertions=yes
70+
71+
- uses: ammaraskar/gcc-problem-matcher@master
72+
73+
- name: Compile
74+
run: make -j "$(nproc)"
75+
76+
- name: Run tests
77+
run: make check
78+
79+
build-macos:
80+
name: macOS (${{ matrix.configure.label }})
81+
runs-on: macos-15
82+
83+
strategy:
84+
fail-fast: false
85+
matrix:
86+
configure:
87+
- { label: "with parser generation", opt: "--enable-parser-generation" }
88+
- { label: "without curl", opt: "--without-curl" }
89+
- { label: "without lua", opt: "--without-lua" }
90+
- { label: "without maxmind", opt: "--without-maxmind" }
91+
- { label: "without libxml", opt: "--without-libxml" }
92+
- { label: "without geoip", opt: "--without-geoip" }
93+
- { label: "without ssdeep", opt: "--without-ssdeep" }
94+
- { label: "with lmdb", opt: "--with-lmdb" }
95+
- { label: "with pcre", opt: "--with-pcre" }
96+
97+
steps:
98+
- uses: actions/checkout@v6
99+
with:
100+
fetch-depth: 0
101+
submodules: true
102+
103+
- name: Ensure submodules are fully initialized (recursive)
104+
run: git submodule update --init --recursive
105+
106+
- name: Install dependencies
107+
# curl and pcre2 are typically already available in the macOS runner image
108+
run: |
109+
brew install autoconf \
110+
automake \
111+
libtool \
112+
yajl \
113+
lmdb \
114+
lua \
115+
libmaxminddb \
116+
libxml2 \
117+
ssdeep \
118+
pcre \
119+
bison \
120+
flex
121+
122+
- name: Build GeoIP library
123+
run: |
124+
git clone --depth 1 --no-checkout https://github.com/maxmind/geoip-api-c.git
125+
cd geoip-api-c
126+
git fetch --tags
127+
# last release v1.6.12
128+
git checkout 4b526e7331ca1d692b74a0509ddcc725622ed31a
129+
autoreconf --install
130+
./configure --disable-dependency-tracking --disable-silent-rules --prefix=/opt/homebrew
131+
make install
132+
133+
- name: Run build preparation script
134+
run: ./build.sh
135+
136+
- name: Configure
137+
run: ./configure ${{ matrix.configure.opt }} --enable-assertions=yes
138+
139+
- uses: ammaraskar/gcc-problem-matcher@master
140+
141+
- name: Compile
142+
run: make -j "$(sysctl -n hw.logicalcpu)"
143+
144+
- name: Run tests
145+
run: make check
146+
147+
build-windows:
148+
name: Windows (${{ matrix.platform.label }}, ${{ matrix.configure.label }})
149+
runs-on: windows-2025
150+
151+
strategy:
152+
fail-fast: false
153+
matrix:
154+
platform:
155+
- { label: "x64", arch: "x86_64" }
156+
configuration: [Release]
157+
configure:
158+
- { label: "full", opt: "" }
159+
- { label: "without curl", opt: "-DWITH_CURL=OFF" }
160+
- { label: "without lua", opt: "-DWITH_LUA=OFF" }
161+
- { label: "without maxmind", opt: "-DWITH_MAXMIND=OFF" }
162+
- { label: "without libxml", opt: "-DWITH_LIBXML2=OFF" }
163+
- { label: "with lmdb", opt: "-DWITH_LMDB=ON" }
164+
165+
steps:
166+
- uses: actions/checkout@v6
167+
with:
168+
fetch-depth: 0
169+
submodules: true
170+
171+
- name: Ensure submodules are fully initialized (recursive)
172+
run: git submodule update --init --recursive
173+
174+
- name: Install Conan package manager
175+
run: |
176+
pip3 install conan --upgrade
177+
conan profile detect
178+
179+
- uses: ammaraskar/msvc-problem-matcher@master
180+
181+
- name: Build project
182+
shell: cmd
183+
run: vcbuild.bat ${{ matrix.configuration }} ${{ matrix.platform.arch }} NO_ASAN "${{ matrix.configure.opt }}"
184+
185+
- name: Prepare test environment
186+
working-directory: build\win32\build\${{ matrix.configuration }}
187+
env:
188+
BASE_DIR: ..\..\..\..
189+
shell: cmd
190+
run: |
191+
copy unit_tests.exe %BASE_DIR%\test
192+
copy regression_tests.exe %BASE_DIR%\test
193+
copy libModSecurity.dll %BASE_DIR%\test
194+
copy %BASE_DIR%\unicode.mapping %BASE_DIR%\test
195+
md \tmp
196+
md \bin
197+
copy "C:\Program Files\Git\usr\bin\echo.exe" \bin
198+
copy "C:\Program Files\Git\usr\bin\echo.exe" \bin\echo
199+
200+
- name: Disable unsupported tests on Windows
201+
working-directory: test\test-cases\regression
202+
shell: cmd
203+
run: |
204+
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
205+
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
206+
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
207+
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
208+
209+
- name: Run tests
210+
working-directory: build\win32\build
211+
run: ctest -C ${{ matrix.configuration }} --output-on-failure
212+
213+
cppcheck:
214+
name: Static analysis (cppcheck)
215+
runs-on: macos-15
216+
217+
steps:
218+
- uses: actions/checkout@v6
219+
with:
220+
fetch-depth: 0
221+
submodules: true
222+
223+
- name: Ensure submodules are fully initialized (recursive)
224+
run: git submodule update --init --recursive
225+
226+
- name: Install cppcheck
227+
run: |
228+
brew install autoconf automake libtool cppcheck
229+
230+
- name: Configure project
231+
run: |
232+
./build.sh
233+
./configure
234+
235+
- name: Run cppcheck
236+
run: make check-static

0 commit comments

Comments
 (0)