@@ -26,12 +26,17 @@ jobs:
26
26
sudo dpkg --add-architecture i386
27
27
sudo apt-get update -y -qq
28
28
sudo apt-get install -y make autoconf automake make libyajl-dev libxml2-dev libmaxminddb-dev libcurl4-gnutls-dev $COMPDEPS
29
- - name : Install ModSecurity library
30
- env :
31
- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
29
+ - name : Get libModSecurity source
30
+ uses : actions/checkout@v4
31
+ with :
32
+ repository : owasp-modsecurity/ModSecurity
33
+ path : ModSecurity
34
+ submodules : true
35
+ fetch-depth : 1
36
+ - name : Build libModSecurity
37
+ working-directory : ModSecurity
32
38
run : |
33
- gh release download -p "*.tar.gz" -R owasp-modsecurity/ModSecurity -O - | tar -xzf -
34
- cd modsecurity-*
39
+ ./build.sh
35
40
./configure --without-lmdb --prefix=/usr
36
41
make -j $(nproc)
37
42
sudo make install
@@ -45,13 +50,26 @@ jobs:
45
50
repository : nginx/nginx
46
51
path : nginx
47
52
fetch-depth : 1
53
+ - name : Get Nginx tests
54
+ uses : actions/checkout@v4
55
+ with :
56
+ repository : nginx/nginx-tests
57
+ path : nginx/test
58
+ fetch-depth : 1
59
+ - name : Copy ModSecurity-nginx tests to nginx/test
60
+ run : |
61
+ cp ModSecurity-nginx/tests/* nginx/test
48
62
- name : Build nginx with ModSecurity-nginx module
49
63
working-directory : nginx
50
64
run : |
51
- ./auto/configure --with-ld-opt="-Wl,-rpath,/usr/local/lib" --without-pcre2 --add-module=../ModSecurity-nginx
65
+ ./auto/configure --with-ld-opt="-Wl,-rpath,/usr/local/lib" --without-pcre2 --with-http_v2_module --with-http_auth_request_module -- add-module=../ModSecurity-nginx
52
66
make
53
67
make modules
54
68
sudo make install
69
+ - name : Run ModSecurity-nginx tests
70
+ working-directory : nginx/test
71
+ run : |
72
+ TEST_NGINX_BINARY=../objs/nginx prove modsecurity*.t
55
73
- name : Start Nginx
56
74
run : |
57
75
sudo /usr/local/nginx/sbin/nginx -c /home/runner/work/ModSecurity-nginx/ModSecurity-nginx/ModSecurity-nginx/.github/nginx/nginx.conf
0 commit comments