]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
github-ci: add windivert build 8837/head
authorVictor Julien <vjulien@oisf.net>
Sun, 7 May 2023 05:42:13 +0000 (07:42 +0200)
committerVictor Julien <vjulien@oisf.net>
Sun, 7 May 2023 17:51:52 +0000 (19:51 +0200)
(cherry picked from commit 74326a43e7cff0665c6973abad9b4accfcfb952d)

.github/workflows/builds.yml

index 177766a123d4cf31a05490c8f23bd03198399f42..35c41f4ef7f03c34453e0d1e6d51f2dea239e485 100644 (file)
@@ -1517,3 +1517,50 @@ jobs:
           ./src/suricata --build-info
           ./src/suricata -u -l /tmp/
           python3 ./suricata-verify/run.py -q
+
+  windows-msys2-mingw64-windivert:
+    name: Windows MSYS2 MINGW64 (WinDivert)
+    runs-on: windows-latest
+    needs: [prepare-deps]
+    defaults:
+      run:
+        shell: msys2 {0}
+    steps:
+      - name: Cache ~/.cargo
+        uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
+        with:
+          path: ~/.cargo
+          key: ${{ github.job }}-cargo
+      - uses: actions/checkout@v3.3.0
+      - uses: msys2/setup-msys2@fa138fa56e2558760b9f2205135313c7345c5f3f
+        with:
+          msystem: MINGW64
+          update: true
+          install: git mingw-w64-x86_64-toolchain automake1.16 automake-wrapper autoconf libtool libyaml-devel pcre-devel jansson-devel make mingw-w64-x86_64-libyaml mingw-w64-x86_64-pcre mingw-w64-x86_64-rust mingw-w64-x86_64-jansson unzip p7zip python-setuptools mingw-w64-x86_64-python-yaml mingw-w64-x86_64-jq mingw-w64-x86_64-libxml2 libpcap-devel mingw-w64-x86_64-libpcap
+      # hack: install our own cbindgen system wide as we can't get the
+      # preinstalled one to be picked up by configure
+      - name: cbindgen
+        run: cargo install --root /usr --force --debug --version 0.24.3 cbindgen
+      - uses: actions/checkout@v3.3.0
+      - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
+        with:
+          name: prep
+          path: prep
+      - run: tar xf prep/libhtp.tar.gz
+      - name: WinDivert
+        run: |
+          curl -sL -O https://github.com/basil00/Divert/releases/download/v1.4.3/WinDivert-1.4.3-A.zip
+          unzip WinDivert-1.4.3-A.zip -d /windivert
+          cp /windivert/WinDivert-1.4.3-A/x86_64/* /usr/lib/
+          # hack: place dlls in cwd
+          cp /windivert/WinDivert-1.4.3-A/x86_64/*.dll .
+      - name: Build
+        run: |
+          ./autogen.sh
+          CFLAGS="-ggdb -Werror" ./configure --enable-gccprotect --disable-gccmarch-native --disable-shared --enable-windivert --with-windivert-include=/windivert/WinDivert-1.4.3-A/include --with-windivert-libraries=/windivert/WinDivert-1.4.3-A/x86_64
+          make -j3
+      - name: Run
+        run: |
+          # need cwd in path due to dlls (see above)
+          PATH="$PATH:$(pwd)" ./src/suricata --build-info
+      - run: make install