Skip to content

Commit 43b0531

Browse files
committed
Updated Linux GH workflow
- Include steps to run all ModSecurity-nginx tests - Simplify checkout of libModSecurity
1 parent 9dc6c6f commit 43b0531

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

Diff for: .github/workflows/test.yml

+24-6
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,17 @@ jobs:
2626
sudo dpkg --add-architecture i386
2727
sudo apt-get update -y -qq
2828
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
3238
run: |
33-
gh release download -p "*.tar.gz" -R owasp-modsecurity/ModSecurity -O - | tar -xzf -
34-
cd modsecurity-*
39+
./build.sh
3540
./configure --without-lmdb --prefix=/usr
3641
make -j $(nproc)
3742
sudo make install
@@ -45,13 +50,26 @@ jobs:
4550
repository: nginx/nginx
4651
path: nginx
4752
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
4862
- name: Build nginx with ModSecurity-nginx module
4963
working-directory: nginx
5064
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
5266
make
5367
make modules
5468
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
5573
- name: Start Nginx
5674
run: |
5775
sudo /usr/local/nginx/sbin/nginx -c /home/runner/work/ModSecurity-nginx/ModSecurity-nginx/ModSecurity-nginx/.github/nginx/nginx.conf

0 commit comments

Comments
 (0)