mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-13 13:26:01 +03:00
121 lines
4.6 KiB
YAML
121 lines
4.6 KiB
YAML
name: Quality Assurance
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
build-linux:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-22.04]
|
|
platform: [x32, x64]
|
|
compiler: [gcc, clang]
|
|
configure:
|
|
- {label: "with parser generation", opt: "--enable-parser-generation" }
|
|
- {label: "wo curl", opt: "--without-curl" }
|
|
- {label: "wo yajl", opt: "--without-yajl" }
|
|
- {label: "wo geoip", opt: "--without-geoip" }
|
|
- {label: "wo lmdb", opt: "--without-lmdb" }
|
|
- {label: "with pcre2", opt: "--with-pcre2" }
|
|
- {label: "wo lua", opt: "--without-lua" }
|
|
- {label: "without maxmind", opt: "--without-maxmind" }
|
|
steps:
|
|
- name: Setup Dependencies
|
|
run: |
|
|
sudo apt-get update -y -qq
|
|
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
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: true
|
|
- name: build.sh
|
|
run: ./build.sh
|
|
- name: configure ${{ matrix.configure.label }}
|
|
run: ./configure ${{ matrix.configure.opt }}
|
|
- uses: ammaraskar/gcc-problem-matcher@master
|
|
- name: make
|
|
run: make -j `nproc`
|
|
- name: check
|
|
run: make check
|
|
- name: check-static
|
|
run: make check-static
|
|
|
|
build-macos:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [macos-12]
|
|
compiler: [clang]
|
|
configure:
|
|
- {label: "with parser generation", opt: "--enable-parser-generation" }
|
|
- {label: "wo curl", opt: "--without-curl" }
|
|
- {label: "wo yajl", opt: "--without-yajl" }
|
|
- {label: "wo geoip", opt: "--without-geoip" }
|
|
- {label: "wo lmdb", opt: "--without-lmdb" }
|
|
- {label: "wo ssdeep", opt: "--without-ssdeep" }
|
|
- {label: "wo lua", opt: "--without-lua" }
|
|
- {label: "wo maxmind", opt: "--without-maxmind" }
|
|
steps:
|
|
- name: Setup Dependencies
|
|
run: |
|
|
brew install autoconf automake cppcheck lmdb libyaml lua ssdeep libmaxminddb bison
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: true
|
|
- name: build.sh
|
|
run: ./build.sh
|
|
- name: configure ${{ matrix.configure.label }}
|
|
run: ./configure ${{ matrix.configure.opt }}
|
|
- uses: ammaraskar/gcc-problem-matcher@master
|
|
- name: make
|
|
run: make -j `sysctl -n hw.logicalcpu`
|
|
- name: check
|
|
run: make check
|
|
|
|
build-windows:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [windows-2022]
|
|
platform: [x86_64]
|
|
configuration: [Release]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: true
|
|
- name: Install Conan
|
|
run: |
|
|
pip3 install conan --upgrade
|
|
conan profile detect
|
|
- uses: ammaraskar/msvc-problem-matcher@master
|
|
- name: Build ${{ matrix.configuration }} ${{ matrix.platform }}
|
|
shell: cmd
|
|
run: vcbuild.bat ${{ matrix.configuration }} ${{ matrix.platform }}
|
|
- name: Set up 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 tests that don't work 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
|