Skip to content

Commit

Permalink
Merge branch 'dev' into optional_git
Browse files Browse the repository at this point in the history
  • Loading branch information
clementperon authored Feb 11, 2024
2 parents 34b2a42 + de2f3ab commit 7118653
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 4 deletions.
80 changes: 77 additions & 3 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,11 @@ jobs:
- name: Test Tutorials
run: cd build_examples/tutorials_bin && ./Tutorial-HelloWorld

macos:
macos-x86:
runs-on: ${{ matrix.os-version }}
strategy:
matrix:
os-version: [macos-11, macos-12]
os-version: [macos-12, macos-13]
arch: [x86_64, arm64]
# Handle ZSTD build by Cirrus CI
# config-zstd: [ON, OFF]
Expand All @@ -242,7 +242,8 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: "3.8.x"
# support version: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
python-version: "3.12"

- name: Configure PcapPlusPlus
# Ensure user have access to network devices instead of giving super-user right
Expand Down Expand Up @@ -304,6 +305,79 @@ jobs:
fail_ci_if_error: false
verbose: true

macos-m1:
runs-on: ${{ matrix.os-version }}
strategy:
matrix:
os-version: [macos-14]

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

- uses: actions/setup-python@v5
with:
# support version: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json
python-version: "3.12"

- name: Configure PcapPlusPlus
# Ensure user have access to network devices instead of giving super-user right
# Seems macos-14 has more strict file permission
run: |
sudo chmod a+rw /dev/bpf*
sudo chmod a+rw /usr/local
cmake -DPCAPPP_BUILD_COVERAGE=ON -S . -B "$BUILD_DIR"
- name: Build PcapPlusPlus
run: cmake --build "$BUILD_DIR" -j

- name: Check architecture
run: lipo $BUILD_DIR/Pcap++/libPcap++.a -verify_arch arm64

- name: Install Tcpreplay
run: brew install tcpreplay

- name: Test PcapPlusPlus
run: |
python -m pip install -U pip
python -m pip install -r ci/run_tests/requirements.txt
python ci/run_tests/run_tests.py --interface en0
- name: Test Examples
run: |
cd Tests/ExamplesTest
python -m pip install -U pip
python -m pip install -r requirements.txt
python -m pytest --interface en0 --use-sudo --root-path=../../Dist/examples_bin
- name: Check installation
run: |
cmake -DPCAPPP_BUILD_COVERAGE=OFF -S . -B "$BUILD_DIR"
cmake --build "$BUILD_DIR" -j
cmake --install "$BUILD_DIR"
- name: Build Tutorials
run: |
mkdir -p build_examples
cmake -DPCAPPP_BUILD_TUTORIALS=ON -S Examples -B build_examples
cmake --build build_examples -j
- name: Test Tutorials
run: cd build_examples/tutorials_bin && ./Tutorial-HelloWorld

- name: Create Cobertura Report
run: |
python3 -m pip install gcovr
gcovr -v -r . $GCOVR_FLAGS -o coverage.xml
- name: Upload Coverage Results
uses: codecov/[email protected]
with:
files: ./coverage.xml
flags: ${{ matrix.os-version }},unittest
fail_ci_if_error: false
verbose: true

mingw-w64:
runs-on: windows-latest
strategy:
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
push:
tags:
- '*'
pull_request:
paths:
# Also run this workflow when this package.yml is update by a PR
- '.github/workflows/package.yml'

env:
BUILD_DIR: Dist
Expand Down Expand Up @@ -58,6 +62,7 @@ jobs:
run: cmake --build "$BUILD_DIR" --target package

- name: Upload binaries to release
if: github.ref_type == 'tag'
uses: ncipollo/release-action@v1
with:
draft: true
Expand All @@ -66,7 +71,7 @@ jobs:
artifacts: "${{ env.BUILD_DIR }}/*.tar.gz,${{ env.BUILD_DIR }}/*.deb,${{ env.BUILD_DIR }}/*.rpm"

freebsd:
runs-on: macos-12
runs-on: ubuntu-latest
strategy:
matrix:
include:
Expand All @@ -90,6 +95,7 @@ jobs:
cmake --build "$BUILD_DIR" --target package
- name: Upload binaries to release
if: github.ref_type == 'tag'
uses: ncipollo/release-action@v1
with:
draft: true
Expand Down Expand Up @@ -123,6 +129,7 @@ jobs:
run: cmake --build "$BUILD_DIR" --target package

- name: Upload binaries to release
if: github.ref_type == 'tag'
uses: ncipollo/release-action@v1
with:
draft: true
Expand Down Expand Up @@ -183,6 +190,7 @@ jobs:
run: cmake --build "$BUILD_DIR" --target package

- name: Upload binaries to release
if: github.ref_type == 'tag'
uses: ncipollo/release-action@v1
with:
draft: true
Expand Down Expand Up @@ -222,6 +230,7 @@ jobs:
run: cmake --build "$env:BUILD_DIR" --config ${{ matrix.configuration }} --target package

- name: Upload binaries to release
if: github.ref_type == 'tag'
uses: ncipollo/release-action@v1
with:
draft: true
Expand Down Expand Up @@ -300,6 +309,7 @@ jobs:
echo "PACKAGE_DIR=$PACKAGE_DIR" >> $GITHUB_ENV
tar cvf "${PACKAGE_DIR}.tar.gz" "${PACKAGE_DIR}"
- name: Upload binaries to release
if: github.ref_type == 'tag'
uses: ncipollo/release-action@v1
with:
draft: true
Expand Down

0 comments on commit 7118653

Please sign in to comment.