From: Jason Ish Date: Mon, 7 Oct 2024 15:52:30 +0000 (-0600) Subject: github-ci: run macos python jobs in virtualenv X-Git-Tag: suricata-7.0.8~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9dd3994bdf3ea1d3eb67d48ed9f69d900d2d525d;p=thirdparty%2Fsuricata.git github-ci: run macos python jobs in virtualenv With the latest brew changes, a virtualenv is required to install pyyaml. (cherry picked from commit 2b16369071da1976c853b7682eb062c5485338c0) --- diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index ccb119bbfe..7e771a6c66 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -2393,6 +2393,7 @@ jobs: brew install \ autoconf \ automake \ + cbindgen \ curl \ hiredis \ jansson \ @@ -2401,15 +2402,12 @@ jobs: libnet \ libtool \ libyaml \ - pyyaml \ lua \ pcre2 \ pkg-config \ python \ rust \ xz - - name: Install cbindgen - run: cargo install --debug --version 0.24.3 cbindgen - run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH - uses: actions/checkout@v3.5.3 - name: Downloading prep archive @@ -2419,6 +2417,12 @@ jobs: path: prep - run: tar xvf prep/libhtp.tar.gz - run: tar xvf prep/suricata-update.tar.gz + - name: Create Python virtual environment + run: python3 -m venv ./testenv + - name: Install PyYAML + run: | + . ./testenv/bin/activate + pip install pyyaml - run: ./autogen.sh - run: CPATH="$HOMEBREW_PREFIX/include:$CPATH" LIBRARY_PATH="$HOMEBREW_PREFIX/lib:$LIBRARY_PATH" PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH" CFLAGS="${DEFAULT_CFLAGS}" ./configure --enable-unittests --prefix="$HOME/.local/" - run: CPATH="$HOMEBREW_PREFIX/include:$CPATH" LIBRARY_PATH="$HOMEBREW_PREFIX/lib:$LIBRARY_PATH" PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH" CFLAGS="${DEFAULT_CFLAGS}" make -j2 @@ -2426,9 +2430,15 @@ jobs: - run: rm libhtp/VERSION && make check - run: tar xf prep/suricata-verify.tar.gz - name: Running suricata-verify - run: python3 ./suricata-verify/run.py -q --debug-failed + run: | + . ./testenv/bin/activate + python3 ./suricata-verify/run.py -q --debug-failed - run: make install - - run: suricata-update -V + - name: Check Suricata-Update + run: | + . ./testenv/bin/activate + which suricata-update + python3 $(which suricata-update) -V - run: suricatasc -h windows-msys2-mingw64-npcap: