Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 50 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ name: Quality Assurance
on:
push:
pull_request:

jobs:
build-linux:
name: Linux (${{ matrix.platform.label }}, ${{ matrix.compiler.label }}, ${{ matrix.configure.label }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
platform:
Expand All @@ -33,18 +34,49 @@ jobs:
- platform: {label: "x32"}
configure: {label: "wo ssdeep"}
steps:
- name: Detect latest Lua dev package
id: detect_lua
shell: bash
run: |
set -euo pipefail

sudo apt-get update -y -qq

CANDIDATES="$(apt-cache pkgnames | grep -E '^liblua[0-9]+\.[0-9]+-dev$' || true)"

if [ -z "$CANDIDATES" ]; then
echo "No libluaX.Y-dev package found"
exit 1
fi

BEST_PKG="$(
printf '%s\n' "$CANDIDATES" \
| sed -E 's/^liblua([0-9]+\.[0-9]+)-dev$/\1 &/' \
| sort -V \
| tail -n1 \
| awk '{print $2}'
)"

if [ -z "$BEST_PKG" ]; then
echo "Failed to determine Lua package"
exit 1
fi

echo "lua_pkg=$BEST_PKG" >> "$GITHUB_OUTPUT"
echo "Using $BEST_PKG"

- name: Setup Dependencies (common)
run: |
sudo dpkg --add-architecture ${{ matrix.platform.arch }}
sudo apt-get update -y -qq
sudo apt-get install -y libyajl-dev:${{ matrix.platform.arch }} \
libcurl4-openssl-dev:${{ matrix.platform.arch }} \
liblmdb-dev:${{ matrix.platform.arch }} \
liblua5.2-dev:${{ matrix.platform.arch }} \
${{ steps.detect_lua.outputs.lua_pkg }}:${{ matrix.platform.arch }} \
libmaxminddb-dev:${{ matrix.platform.arch }} \
libpcre2-dev:${{ matrix.platform.arch }} \
pcre2-utils:${{ matrix.platform.arch }} \
bison flex
bison flex python3 python3-venv
- name: Setup Dependencies (x32)
if: ${{ matrix.platform.label == 'x32' }}
run: |
Expand All @@ -54,11 +86,11 @@ jobs:
- name: Setup Dependencies (x64)
if: ${{ matrix.platform.label == 'x64' }}
run: |
sudo apt-get install -y libgeoip-dev:${{ matrix.platform.arch }} \
libfuzzy-dev:${{ matrix.platform.arch }}
- uses: actions/checkout@v4
sudo apt-get install -y libfuzzy-dev:${{ matrix.platform.arch }}

- uses: actions/checkout@v6
with:
submodules: true
submodules: recursive
fetch-depth: 0
- name: build.sh
run: ./build.sh
Expand All @@ -77,6 +109,7 @@ jobs:
name: macOS (${{ matrix.configure.label }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-14]
configure:
Expand Down Expand Up @@ -105,21 +138,12 @@ jobs:
ssdeep \
pcre \
bison \
flex
- uses: actions/checkout@v4
flex

- uses: actions/checkout@v6
with:
submodules: true
submodules: recursive
fetch-depth: 0
- name: Build GeoIP
run: |
git clone --depth 1 --no-checkout https://github.com/maxmind/geoip-api-c.git
cd geoip-api-c
git fetch --tags
# Check out the last release, v1.6.12
git checkout 4b526e7331ca1d692b74a0509ddcc725622ed31a
autoreconf --install
./configure --disable-dependency-tracking --disable-silent-rules --prefix=/opt/homebrew
make install
- name: build.sh
run: ./build.sh
- name: configure
Expand All @@ -134,6 +158,7 @@ jobs:
name: Windows (${{ matrix.platform.label }}, ${{ matrix.configure.label }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-2022]
platform:
Expand All @@ -147,9 +172,9 @@ jobs:
- {label: "wo libxml", opt: "-DWITH_LIBXML2=OFF" }
- {label: "with lmdb", opt: "-DWITH_LMDB=ON" }
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
submodules: true
submodules: recursive
fetch-depth: 0
- name: Install Conan
run: |
Expand Down Expand Up @@ -195,9 +220,10 @@ jobs:
automake \
libtool \
cppcheck
- uses: actions/checkout@v4

- uses: actions/checkout@v6
with:
submodules: true
submodules: recursive
fetch-depth: 0
- name: configure
run: |
Expand Down
92 changes: 82 additions & 10 deletions .github/workflows/ci_new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,39 @@ jobs:
fetch-depth: 0
submodules: recursive

- name: Install dependencies
- name: Detect latest Lua dev package
id: detect_lua
shell: bash
run: |
set -euo pipefail

sudo apt-get update -y -qq

CANDIDATES="$(apt-cache search '^liblua[0-9]+\.[0-9]+-dev$' | awk '{print $1}')"

if [ -z "$CANDIDATES" ]; then
echo "No libluaX.Y-dev package found"
exit 1
fi

BEST_PKG="$(
printf '%s\n' "$CANDIDATES" \
| sed -E 's/^liblua([0-9]+\.[0-9]+)-dev$/\1 &/' \
| sort -V \
| tail -n1 \
| awk '{print $2}'
)"

echo "lua_pkg=$BEST_PKG" >> "$GITHUB_OUTPUT"
echo "Using $BEST_PKG"

- name: Install dependencies
run: |
sudo apt-get install -y \
libyajl-dev \
libcurl4-openssl-dev \
liblmdb-dev \
liblua5.2-dev \
${{ steps.detect_lua.outputs.lua_pkg }} \
libmaxminddb-dev \
libpcre2-dev \
libxml2-dev \
Expand All @@ -56,8 +81,9 @@ jobs:
libpcre3-dev \
bison \
flex \
pkg-config

pkg-config \
python3 \
python3-venv

- name: Run build preparation script
run: ./build.sh
Expand All @@ -78,11 +104,12 @@ jobs:

build-macos:
name: macOS (${{ matrix.configure.label }})
runs-on: macos-15
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [macos-15, macos-26]
configure:
- { label: "with parser generation", opt: "--enable-parser-generation" }
- { label: "without curl", opt: "--without-curl" }
Expand Down Expand Up @@ -196,7 +223,7 @@ jobs:

cppcheck:
name: Static analysis (cppcheck)
runs-on: macos-15
runs-on: macos-26

steps:
- uses: actions/checkout@v6
Expand Down Expand Up @@ -234,11 +261,47 @@ jobs:
with:
fetch-depth: 0
submodules: recursive

- name: Detect latest Lua packages
id: detect_lua
shell: bash
run: |
set -euo pipefail

apt-get update

CANDIDATES="$(apt-cache pkgnames | grep -E '^liblua[0-9]+\.[0-9]+-dev$' || true)"

if [ -z "$CANDIDATES" ]; then
echo "No libluaX.Y-dev package found"
exit 1
fi

BEST_PKG="$(
printf '%s\n' "$CANDIDATES" \
| sed -E 's/^liblua([0-9]+\.[0-9]+)-dev$/\1 &/' \
| sort -V \
| tail -n1 \
| awk '{print $2}'
)"

if [ -z "$BEST_PKG" ]; then
echo "Failed to determine Lua dev package"
printf '%s\n' "$CANDIDATES"
exit 1
fi

BEST_VER="$(printf '%s\n' "$BEST_PKG" | sed -E 's/^liblua([0-9]+\.[0-9]+)-dev$/\1/')"
LUA_PKG="lua$BEST_VER"

echo "lua_dev_pkg=$BEST_PKG" >> "$GITHUB_OUTPUT"
echo "lua_pkg=$LUA_PKG" >> "$GITHUB_OUTPUT"

echo "Using dev package: $BEST_PKG"
echo "Using interpreter: $LUA_PKG"

- name: Install dependencies (v2 style)
run: |
apt-get update
apt-get install -y \
autoconf \
automake \
Expand All @@ -249,15 +312,24 @@ jobs:
libyajl-dev \
libcurl4-openssl-dev \
liblmdb-dev \
liblua5.2-dev \
${{ steps.detect_lua.outputs.lua_dev_pkg }} \
${{ steps.detect_lua.outputs.lua_pkg }} \
libmaxminddb-dev \
libpcre2-dev \
libxml2-dev \
libfuzzy-dev \
pcre2-utils \
bison \
flex

flex \
python3 \
python3-venv

- name: Show Lua installation
run: |
which lua || true
lua -v || true
dpkg -l | grep lua || true

- name: Run build preparation script
run: ./build.sh

Expand Down
Loading