mirror of
https://github.com/optim-enterprises-bv/nDPId.git
synced 2025-11-02 11:17:49 +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: |
|
run: |
|
||||||
pip install gcovr==5.0 # 5.1 is not supported
|
pip install gcovr==5.0 # 5.1 is not supported
|
||||||
- name: Install sonar-scanner and build-wrapper
|
- 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
|
- name: Install Prerequisites
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ GIT_EXEC="$(command -v git || printf '%s' "")"
|
|||||||
WGET_EXEC="$(command -v wget || printf '%s' "")"
|
WGET_EXEC="$(command -v wget || printf '%s' "")"
|
||||||
UNZIP_EXEC="$(command -v unzip || printf '%s' "")"
|
UNZIP_EXEC="$(command -v unzip || printf '%s' "")"
|
||||||
MAKE_EXEC="$(command -v make || printf '%s' "")"
|
MAKE_EXEC="$(command -v make || printf '%s' "")"
|
||||||
|
FLOCK_EXEC="$(command -v flock || printf '%s' "")"
|
||||||
|
|
||||||
if [ -z "${NDPI_COMMIT_HASH}" ]; then
|
if [ -z "${NDPI_COMMIT_HASH}" ]; then
|
||||||
NDPI_COMMIT_HASH="dev"
|
NDPI_COMMIT_HASH="dev"
|
||||||
@@ -14,15 +15,15 @@ else
|
|||||||
GITHUB_FALLBACK_URL="https://github.com/ntop/nDPI/archive/${NDPI_COMMIT_HASH}.zip"
|
GITHUB_FALLBACK_URL="https://github.com/ntop/nDPI/archive/${NDPI_COMMIT_HASH}.zip"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${GIT_EXEC}" -o -z "${WGET_EXEC}" -o -z "${UNZIP_EXEC}" -o -z "${MAKE_EXEC}" ]; then
|
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" >&2
|
printf '%s\n' "Required Executables missing: git, wget, unzip, make, flock" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LOCKFILE="$(realpath "${0}").lock"
|
LOCKFILE="$(realpath "${0}").lock"
|
||||||
touch "${LOCKFILE}"
|
touch "${LOCKFILE}"
|
||||||
exec 42< "${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;
|
printf '%s\n' "Could not aquire file lock for ${0}. Already running instance?" >&2;
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user