Skip to content

Merge pull request #2200 from atomicturtle/issue747 #6

Merge pull request #2200 from atomicturtle/issue747

Merge pull request #2200 from atomicturtle/issue747 #6

# Multi-platform build workflow.
# Initial CI structure and idea from PR #2158 by @cmac9203. Adapted to use the
# project's Make-based build (OSSEC-HIDS does not use CMake).
name: Build (multi-platform)
on:
push:
branches: [ "main", "master" ]
pull_request:
branches: [ "main", "master" ]
workflow_dispatch: # Run manually from Actions tab (choose branch)
jobs:
build-rocky:
name: Rocky Linux 9 (${{ matrix.target }}, USE_CURL=${{ matrix.use_curl }})
runs-on: ubuntu-latest
container: rockylinux:9
strategy:
fail-fast: false
matrix:
target: [ server, agent ]
# Exercise optional libcurl SMTP path (curlmail.c) in CI, not only local builds.
use_curl: [ no, yes ]
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
dnf install -y dnf-plugins-core
dnf config-manager --set-enabled crb || true
dnf install -y gcc make openssl-devel pcre2-devel zlib-devel \
systemd-devel libevent-devel
dnf install -y file-devel || true
if [ "${{ matrix.use_curl }}" = "yes" ]; then
dnf install -y libcurl-devel
fi
- name: Build
run: |
cd src
if [ "${{ matrix.use_curl }}" = "yes" ]; then
make TARGET=${{ matrix.target }} PCRE2_SYSTEM=yes USE_CURL=yes -j$(nproc)
else
make TARGET=${{ matrix.target }} PCRE2_SYSTEM=yes -j$(nproc)
fi
build-windows-agent:
name: Windows agent (cross-compile)
runs-on: ubuntu-latest
container: fedora:40
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
dnf -y install \
gcc \
make \
mingw32-gcc \
mingw32-binutils \
mingw32-nsis \
mingw32-pcre2 \
mingw32-zlib \
mingw32-openssl \
perl \
wget \
tar \
perl-Time-HiRes \
which
- name: Build Windows agent
run: |
cd src
make TARGET=winagent PCRE2_SYSTEM=yes ZLIB_SYSTEM=yes -j$(nproc)