CPP Adaption #47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Cross-platform Build | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| env: | |
| CMAKE_BUILD_TYPE: Release | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up CMake | |
| uses: lukka/get-cmake@v3.29.2 | |
| - name: Install dependencies (Linux) | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| libssl-dev \ | |
| libopencv-dev \ | |
| libpcap-dev \ | |
| libpthread-stubs0-dev \ | |
| git | |
| - name: Clone and build PcapPlusPlus (Linux/macOS) | |
| run: | | |
| git clone --depth 1 https://github.com/seladb/PcapPlusPlus.git | |
| cd PcapPlusPlus | |
| ./configure-linux.sh --default || ./configure-mac_os_x.sh --default | |
| make -j$(nproc || sysctl -n hw.ncpu) | |
| sudo make install | |
| sudo ldconfig || true | |
| - name: Configure CMake | |
| run: | | |
| cmake -S . -B build -DCMAKE_BUILD_TYPE=Release | |
| - name: Build | |
| run: cmake --build build --config Release --parallel | |
| - name: Test binaries | |
| run: | | |
| ./build/heiFIP --help || true | |
| ./build/main --help || true | |
| shell: bash |