Skip to content

Commit 6bf78f2

Browse files
committed
Added GitHub workflow to build libModSecurity on Windows.
1 parent e6e2989 commit 6bf78f2

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,49 @@ jobs:
7272
run: make -j `sysctl -n hw.logicalcpu`
7373
- name: check
7474
run: make check
75+
76+
build-windows:
77+
runs-on: ${{ matrix.os }}
78+
strategy:
79+
matrix:
80+
os: [windows-2022]
81+
platform: [x86_64]
82+
configuration: [Release]
83+
steps:
84+
- uses: actions/checkout@v4
85+
with:
86+
submodules: true
87+
- name: Install Conan
88+
run: |
89+
pip3 install conan --upgrade
90+
conan profile detect
91+
- uses: ammaraskar/msvc-problem-matcher@master
92+
- name: Build ${{ matrix.configuration }} ${{ matrix.platform }}
93+
shell: cmd
94+
run: vcbuild.bat ${{ matrix.configuration }} ${{ matrix.platform }}
95+
- name: Set up test environment
96+
working-directory: build\win32\build\${{ matrix.configuration }}
97+
env:
98+
BASE_DIR: ..\..\..\..
99+
shell: cmd
100+
run: |
101+
copy unit_tests.exe %BASE_DIR%\test
102+
copy regression_tests.exe %BASE_DIR%\test
103+
copy libModSecurity.dll %BASE_DIR%\test
104+
copy %BASE_DIR%\unicode.mapping %BASE_DIR%\test
105+
md \tmp
106+
md \bin
107+
copy "C:\Program Files\Git\usr\bin\echo.exe" \bin
108+
copy "C:\Program Files\Git\usr\bin\echo.exe" \bin\echo
109+
- name: Disable tests that don't work on Windows
110+
working-directory: test\test-cases\regression
111+
shell: cmd
112+
run: |
113+
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
114+
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
115+
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
116+
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
117+
- name: Run tests
118+
working-directory: build\win32\build
119+
run: |
120+
ctest -C ${{ matrix.configuration }} --output-on-failure

0 commit comments

Comments
 (0)