Skip to content

Validate pkt2flow binary with pcap files #17

Validate pkt2flow binary with pcap files

Validate pkt2flow binary with pcap files #17

Workflow file for this run

name: CI
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
jobs:
build-test-analyze:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
build_type: [Release]
steps:
- uses: actions/checkout@v4
- name: Install dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
libpcap-dev \
libgoogle-glog-dev \
libgtest-dev \
cmake \
build-essential \
clang-format
- name: Install dependencies (macOS)
if: matrix.os == 'macos-latest'
run: |
brew update
brew install \
libpcap \
glog \
googletest \
cmake \
clang-format
- name: Check code formatting
env:
PKG_CONFIG_PATH: ${{ matrix.os == 'macos-latest' && '/opt/homebrew/opt/libpcap/lib/pkgconfig' || '' }}
run: |
chmod +x format_code.sh
./format_code.sh --check
- name: Configure CMake
env:
PKG_CONFIG_PATH: ${{ matrix.os == 'macos-latest' && '/opt/homebrew/opt/libpcap/lib/pkgconfig' || '' }}
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DBUILD_TESTS=ON
- name: Build
run: cmake --build build --config ${{ matrix.build_type }} -j $(nproc 2>/dev/null || sysctl -n hw.ncpu)
- name: Run tests
working-directory: build
run: ctest --output-on-failure --verbose
- name: Test installation
run: |
sudo cmake --install build
which pkt2flow
pkt2flow -h || true # Show help (exits with non-zero)
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y doxygen graphviz
- name: Generate documentation
run: |
doxygen --version
# Documentation generation can be added when Doxyfile is created