mirror of
https://github.com/optim-enterprises-bv/nDPId.git
synced 2025-10-28 17:02:24 +00:00
Add FreeBSD CI build
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
39
.github/workflows/build-freebsd.yml
vendored
Normal file
39
.github/workflows/build-freebsd.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: FreeBSD Build
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# At the end of every day
|
||||
- cron: '0 0 * * *'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- tmp
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
types: [opened, synchronize, reopened]
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
name: Build and Test
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Test in FreeBSD
|
||||
id: test
|
||||
uses: vmactions/freebsd-vm@v1
|
||||
with:
|
||||
usesh: true
|
||||
prepare: |
|
||||
pkg install -y bash autoconf automake cmake gmake libtool gettext pkgconf gcc \
|
||||
git wget unzip flock \
|
||||
json-c flex bison libpcap curl openssl dbus
|
||||
run: |
|
||||
echo "Working Directory: $(pwd)"
|
||||
echo "User.............: $(whoami)"
|
||||
echo "FreeBSD Version..: $(freebsd-version)"
|
||||
# TODO: Make examples I/O event agnostic i.e. use nio
|
||||
cmake -S . -B build -DBUILD_NDPI=ON -DBUILD_EXAMPLES=OFF #-DENABLE_CURL=ON -DENABLE_DBUS=ON
|
||||
cmake --build build
|
||||
2
.github/workflows/sonarcloud.yml
vendored
2
.github/workflows/sonarcloud.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
run: |
|
||||
pip install gcovr==5.0 # 5.1 is not supported
|
||||
- name: Install sonar-scanner and build-wrapper
|
||||
uses: SonarSource/sonarcloud-github-c-cpp@v3.1.0
|
||||
uses: SonarSource/sonarcloud-github-c-cpp@v3.2.0
|
||||
- name: Install Prerequisites
|
||||
run: |
|
||||
sudo apt-get update
|
||||
|
||||
@@ -6,6 +6,7 @@ GIT_EXEC="$(command -v git || printf '%s' "")"
|
||||
WGET_EXEC="$(command -v wget || printf '%s' "")"
|
||||
UNZIP_EXEC="$(command -v unzip || printf '%s' "")"
|
||||
MAKE_EXEC="$(command -v make || printf '%s' "")"
|
||||
FLOCK_EXEC="$(command -v flock || printf '%s' "")"
|
||||
|
||||
if [ -z "${NDPI_COMMIT_HASH}" ]; then
|
||||
NDPI_COMMIT_HASH="dev"
|
||||
@@ -14,15 +15,15 @@ else
|
||||
GITHUB_FALLBACK_URL="https://github.com/ntop/nDPI/archive/${NDPI_COMMIT_HASH}.zip"
|
||||
fi
|
||||
|
||||
if [ -z "${GIT_EXEC}" -o -z "${WGET_EXEC}" -o -z "${UNZIP_EXEC}" -o -z "${MAKE_EXEC}" ]; then
|
||||
printf '%s\n' "Required Executables missing: git, wget, unzip, make" >&2
|
||||
if [ -z "${GIT_EXEC}" -o -z "${WGET_EXEC}" -o -z "${UNZIP_EXEC}" -o -z "${MAKE_EXEC}" -o -z "${FLOCK_EXEC}" ]; then
|
||||
printf '%s\n' "Required Executables missing: git, wget, unzip, make, flock" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LOCKFILE="$(realpath "${0}").lock"
|
||||
touch "${LOCKFILE}"
|
||||
exec 42< "${LOCKFILE}"
|
||||
flock -x -n 42 || {
|
||||
${FLOCK_EXEC} -x -n 42 || {
|
||||
printf '%s\n' "Could not aquire file lock for ${0}. Already running instance?" >&2;
|
||||
exit 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user