|
6 | 6 |
|
7 | 7 | jobs:
|
8 | 8 | build-linux:
|
| 9 | + name: Linux (${{ matrix.platform.label }}, ${{ matrix.compiler.label }}, ${{ matrix.configure.label }}) |
9 | 10 | runs-on: ${{ matrix.os }}
|
10 | 11 | strategy:
|
11 | 12 | matrix:
|
12 | 13 | os: [ubuntu-22.04]
|
13 |
| - platform: [x32, x64] |
14 |
| - compiler: [gcc, clang] |
| 14 | + platform: |
| 15 | + - {label: "x64", arch: "amd64", configure: "--enable-assertions=yes"} |
| 16 | + - {label: "x32", arch: "i386", configure: "PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 --enable-assertions=yes"} |
| 17 | + compiler: |
| 18 | + - {label: "gcc", cc: "gcc", cxx: "g++"} |
| 19 | + - {label: "clang", cc: "clang", cxx: "clang++"} |
15 | 20 | configure:
|
16 | 21 | - {label: "with parser generation", opt: "--enable-parser-generation" }
|
17 | 22 | - {label: "wo curl", opt: "--without-curl" }
|
18 |
| - - {label: "wo yajl", opt: "--without-yajl" } |
19 |
| - - {label: "wo geoip", opt: "--without-geoip" } |
20 |
| - - {label: "wo lmdb", opt: "--without-lmdb" } |
21 |
| - - {label: "with pcre2", opt: "--with-pcre2" } |
22 | 23 | - {label: "wo lua", opt: "--without-lua" }
|
23 |
| - - {label: "without maxmind", opt: "--without-maxmind" } |
| 24 | + - {label: "wo maxmind", opt: "--without-maxmind" } |
| 25 | + - {label: "wo libxml", opt: "--without-libxml" } |
| 26 | + - {label: "wo geoip", opt: "--without-geoip" } |
| 27 | + - {label: "wo ssdeep", opt: "--without-ssdeep" } |
| 28 | + - {label: "with lmdb", opt: "--with-lmdb" } |
| 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"} |
24 | 35 | steps:
|
25 |
| - - name: Setup Dependencies |
| 36 | + - name: Setup Dependencies (common) |
26 | 37 | run: |
|
| 38 | + sudo dpkg --add-architecture ${{ matrix.platform.arch }} |
27 | 39 | sudo apt-get update -y -qq
|
28 |
| - sudo apt-get install -y libfuzzy-dev libyajl-dev libgeoip-dev liblua5.2-dev liblmdb-dev cppcheck libmaxminddb-dev libcurl4-openssl-dev libpcre2-dev pcre2-utils |
29 |
| - - uses: actions/checkout@v2 |
| 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 }} |
| 59 | + - uses: actions/checkout@v4 |
30 | 60 | with:
|
31 | 61 | submodules: true
|
| 62 | + fetch-depth: 0 |
32 | 63 | - name: build.sh
|
33 | 64 | run: ./build.sh
|
34 |
| - - name: configure ${{ matrix.configure.label }} |
35 |
| - run: ./configure ${{ matrix.configure.opt }} |
| 65 | + - name: configure |
| 66 | + env: |
| 67 | + CC: ${{ matrix.compiler.cc }} |
| 68 | + CXX: ${{ matrix.compiler.cxx }} |
| 69 | + run: ./configure ${{ matrix.platform.configure }} ${{ matrix.configure.opt }} |
36 | 70 | - uses: ammaraskar/gcc-problem-matcher@master
|
37 | 71 | - name: make
|
38 | 72 | run: make -j `nproc`
|
39 | 73 | - name: check
|
40 | 74 | run: make check
|
41 |
| - - name: check-static |
42 |
| - run: make check-static |
43 | 75 |
|
44 | 76 | build-macos:
|
| 77 | + name: macOS (${{ matrix.configure.label }}) |
45 | 78 | runs-on: ${{ matrix.os }}
|
46 | 79 | strategy:
|
47 | 80 | matrix:
|
48 | 81 | os: [macos-12]
|
49 |
| - compiler: [clang] |
50 | 82 | configure:
|
51 | 83 | - {label: "with parser generation", opt: "--enable-parser-generation" }
|
52 | 84 | - {label: "wo curl", opt: "--without-curl" }
|
53 |
| - - {label: "wo yajl", opt: "--without-yajl" } |
54 |
| - - {label: "wo geoip", opt: "--without-geoip" } |
55 |
| - - {label: "wo lmdb", opt: "--without-lmdb" } |
56 |
| - - {label: "wo ssdeep", opt: "--without-ssdeep" } |
57 | 85 | - {label: "wo lua", opt: "--without-lua" }
|
58 | 86 | - {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 lmdb", opt: "--with-lmdb" } |
| 91 | + - {label: "with pcre2", opt: "--with-pcre2" } |
59 | 92 | steps:
|
60 | 93 | - name: Setup Dependencies
|
| 94 | + # autoconf, curl, pcre2 not installed because they're already |
| 95 | + # included in the image |
61 | 96 | run: |
|
62 |
| - brew install autoconf automake cppcheck lmdb libyaml lua ssdeep libmaxminddb bison |
63 |
| - - uses: actions/checkout@v2 |
| 97 | + brew install automake \ |
| 98 | + yajl \ |
| 99 | + lmdb \ |
| 100 | + lua \ |
| 101 | + libmaxminddb \ |
| 102 | + libxml2 \ |
| 103 | + geoip \ |
| 104 | + ssdeep \ |
| 105 | + pcre \ |
| 106 | + bison \ |
| 107 | + flex |
| 108 | + - uses: actions/checkout@v4 |
64 | 109 | with:
|
65 | 110 | submodules: true
|
| 111 | + fetch-depth: 0 |
66 | 112 | - name: build.sh
|
67 | 113 | run: ./build.sh
|
68 |
| - - name: configure ${{ matrix.configure.label }} |
69 |
| - run: ./configure ${{ matrix.configure.opt }} |
| 114 | + - name: configure |
| 115 | + run: ./configure ${{ matrix.configure.opt }} --enable-assertions=yes |
70 | 116 | - uses: ammaraskar/gcc-problem-matcher@master
|
71 | 117 | - name: make
|
72 | 118 | run: make -j `sysctl -n hw.logicalcpu`
|
73 | 119 | - name: check
|
74 | 120 | run: make check
|
| 121 | + |
| 122 | + build-windows: |
| 123 | + name: Windows (${{ matrix.platform.label }}, ${{ matrix.configure.label }}) |
| 124 | + runs-on: ${{ matrix.os }} |
| 125 | + strategy: |
| 126 | + matrix: |
| 127 | + os: [windows-2022] |
| 128 | + platform: |
| 129 | + - {label: "x64", arch: "x86_64"} |
| 130 | + configuration: [Release] |
| 131 | + configure: |
| 132 | + - {label: "full", opt: "" } |
| 133 | + - {label: "wo curl", opt: "-DWITHOUT_CURL=ON" } |
| 134 | + - {label: "wo lmdb", opt: "-DWITHOUT_LMDB=ON" } |
| 135 | + - {label: "wo lua", opt: "-DWITHOUT_LUA=ON" } |
| 136 | + - {label: "wo maxmind", opt: "-DWITHOUT_MAXMIND=ON" } |
| 137 | + - {label: "wo libxml", opt: "-WITHOUT_LIBXML2=ON" } |
| 138 | + steps: |
| 139 | + - uses: actions/checkout@v4 |
| 140 | + with: |
| 141 | + submodules: true |
| 142 | + fetch-depth: 0 |
| 143 | + - name: Install Conan |
| 144 | + run: | |
| 145 | + pip3 install conan --upgrade |
| 146 | + conan profile detect |
| 147 | + - uses: ammaraskar/msvc-problem-matcher@master |
| 148 | + - name: Build ${{ matrix.configuration }} ${{ matrix.platform.arch }} ${{ matrix.configure.label }} |
| 149 | + shell: cmd |
| 150 | + run: vcbuild.bat ${{ matrix.configuration }} ${{ matrix.platform.arch }} NO_ASAN "${{ matrix.configure.opt }}" |
| 151 | + - name: Set up test environment |
| 152 | + working-directory: build\win32\build\${{ matrix.configuration }} |
| 153 | + env: |
| 154 | + BASE_DIR: ..\..\..\.. |
| 155 | + shell: cmd |
| 156 | + run: | |
| 157 | + copy unit_tests.exe %BASE_DIR%\test |
| 158 | + copy regression_tests.exe %BASE_DIR%\test |
| 159 | + copy libModSecurity.dll %BASE_DIR%\test |
| 160 | + copy %BASE_DIR%\unicode.mapping %BASE_DIR%\test |
| 161 | + md \tmp |
| 162 | + md \bin |
| 163 | + copy "C:\Program Files\Git\usr\bin\echo.exe" \bin |
| 164 | + copy "C:\Program Files\Git\usr\bin\echo.exe" \bin\echo |
| 165 | + - name: Disable tests that don't work on Windows |
| 166 | + working-directory: test\test-cases\regression |
| 167 | + shell: cmd |
| 168 | + run: | |
| 169 | + 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 |
| 170 | + 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 |
| 171 | + 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 |
| 172 | + 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 |
| 173 | + - name: Run tests |
| 174 | + working-directory: build\win32\build |
| 175 | + run: | |
| 176 | + ctest -C ${{ matrix.configuration }} --output-on-failure |
| 177 | +
|
| 178 | + cppcheck: |
| 179 | + runs-on: [ubuntu-22.04] |
| 180 | + steps: |
| 181 | + - name: Setup Dependencies |
| 182 | + run: | |
| 183 | + sudo apt-get update -y -qq |
| 184 | + sudo apt-get install -y cppcheck |
| 185 | + - name: Checkout source |
| 186 | + uses: actions/checkout@v4 |
| 187 | + with: |
| 188 | + submodules: true |
| 189 | + fetch-depth: 0 |
| 190 | + - name: Configure libModSecurity |
| 191 | + run: | |
| 192 | + ./build.sh |
| 193 | + ./configure |
| 194 | + - name: Run cppcheck on libModSecurity |
| 195 | + run: make check-static |
0 commit comments