Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move 3rdParty GetOpt to Examples subdir and add weekly test build with vcpkg #1226

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ jobs:
uses: actions/checkout@v3

- name: Checkout lipbcap for Android
uses: actions/checkout@main
uses: actions/checkout@v3
with:
repository: seladb/libpcap-android
path: ./libpcap-android
Expand All @@ -508,7 +508,7 @@ jobs:
run: cmake --build "$BUILD_DIR" -j

- name: Checkout ToyVpn-PcapPlusPlus
uses: actions/checkout@master
uses: actions/checkout@v3
with:
repository: seladb/ToyVpn-PcapPlusPlus
path: ./ToyVpn-PcapPlusPlus
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/build_vcpkg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: PcapPlusPlus build Examples with vcpkg

on:
schedule:
- cron: '0 0 * * 0' # Runs every Sunday at 00:00 UTC
workflow_dispatch:

jobs:
build-windows:
runs-on: windows-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Vcpkg
run: |
git clone https://github.com/clementperon/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat

- name: Install PcapPlusPlus with Vcpkg
id: vcpkg_setup
continue-on-error: true
run: |
.\vcpkg\vcpkg install pcapplusplus

- name: Build and Test PcapPlusPlus examples
if: steps.vcpkg_setup.outcome == 'success'
run: |
cmake -DCMAKE_TOOLCHAIN_FILE="../vcpkg/scripts/buildsystems/vcpkg.cmake" -S Examples -B build
cmake --build build --config Release

- name: Upload artifact on vcpkg failure
if: steps.vcpkg_setup.outcome == 'failure'
uses: actions/upload-artifact@v3
with:
name: vcpkg-failure-log
path: vcpkg/buildtrees/pcapplusplus

build-linux-macos:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Vcpkg
run: |
git clone https://github.com/clementperon/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh

- name: Install PcapPlusPlus with Vcpkg
id: vcpkg_setup
continue-on-error: true
run: |
./vcpkg/vcpkg install pcapplusplus

- name: Build and Test PcapPlusPlus examples
if: steps.vcpkg_setup.outcome == 'success'
run: |
cmake -DCMAKE_TOOLCHAIN_FILE="../vcpkg/scripts/buildsystems/vcpkg.cmake" -S Examples -B build
cmake --build build

- name: Upload artifact on vcpkg failure
if: steps.vcpkg_setup.outcome == 'failure'
uses: actions/upload-artifact@v3
with:
name: vcpkg-failure-log
path: vcpkg/buildtrees/pcapplusplus
2 changes: 1 addition & 1 deletion .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ jobs:
uses: actions/checkout@v3

- name: Checkout lipbcap for Android
uses: actions/checkout@main
uses: actions/checkout@v3
with:
repository: seladb/libpcap-android
path: ./libpcap-android
Expand Down
1 change: 0 additions & 1 deletion 3rdParty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
set(CMAKE_CXX_CLANG_TIDY "")

add_subdirectory(EndianPortable)
add_subdirectory(Getopt-for-Visual-Studio)
add_subdirectory(hash-library)
add_subdirectory(json)
add_subdirectory(LightPcapNg)
Expand Down
4 changes: 4 additions & 0 deletions Examples/3rdParty/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Disable Clang-tidy for 3rdParty modules
set(CMAKE_CXX_CLANG_TIDY "")

add_subdirectory(Getopt-for-Visual-Studio)
2 changes: 2 additions & 0 deletions Examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ else()
message(STATUS "Include dir: ${PcapPlusPlus_INCLUDE_DIR}")
endif()

add_subdirectory(3rdParty)

add_subdirectory(Arping)
add_subdirectory(ArpSpoofing)
add_subdirectory(DNSResolver)
Expand Down
1 change: 1 addition & 0 deletions cppcheckSuppressions.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*:3rdParty/*
*:Examples/3rdParty/*

ConfigurationNotChecked:*
ctuOneDefinitionRuleViolation:Examples/*
Expand Down