From 401b5db53c175fecf286a4208e15880ce701bd2d Mon Sep 17 00:00:00 2001 From: "Liu, An-Chi" Date: Mon, 24 Jun 2024 15:18:43 +0900 Subject: [PATCH] Freebsd CI and Remove CirrusCI (#1460) * remove all ci for testing * test freebsd * test * update * Revert "remove all ci for testing" This reverts commit e1368e04517580984db2f8ea5217ef5c35f7bcfc. * final * lint * using names for each command * remove cirrus * Revert "using names for each command" This reverts commit ea47e833ec5b5a3bb376a0843739a0b93bcde68d. --- .cirrus.yml | 28 -------------------- .github/workflows/build_and_test.yml | 38 ++++++++++++++++++++++++++++ README.md | 1 - 3 files changed, 38 insertions(+), 29 deletions(-) delete mode 100644 .cirrus.yml diff --git a/.cirrus.yml b/.cirrus.yml deleted file mode 100644 index aeb8e8c345..0000000000 --- a/.cirrus.yml +++ /dev/null @@ -1,28 +0,0 @@ -env: - BUILD_DIR: "build" - GCOVR_FLAGS: "--gcov-ignore-parse-errors --exclude-throw-branches --filter Common --filter Pcap --filter Packet --xml" - -#task: -# name: Test FreeBSD -# freebsd_instance: -# matrix: -# image_family: freebsd-13-3 -# image_family: freebsd-14-0 -# install_script: -# - pkg install -y bash cmake git gmake gsed libpcap tcpreplay -# configure_script: -# # Ensure user have access to network devices instead of giving super-user right -# - chmod a+rw /dev/bpf* -# - cmake -S . -B Dist -# build_script: -# - cmake --build Dist -j 2 -# test_pcapplusplus_script: -# - ifconfig vtnet0 promisc -# - python -m ensurepip -# - python -m pip install -r ci/run_tests/requirements.txt -# - python ci/run_tests/run_tests.py --interface vtnet0 -# test_examples_script: -# - cd Tests/ExamplesTest -# - python -m ensurepip -# - python -m pip install -r requirements.txt -# - python -m pytest --interface vtnet0 --root-path=../../Dist/examples_bin diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 7fcf99079c..6399fc1d59 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -571,6 +571,44 @@ jobs: env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + freebsd: + runs-on: ubuntu-latest + strategy: + matrix: + version: ["14.0", "13.2"] + steps: + - uses: actions/checkout@v4 + - name: Test in FreeBSD + id: test + uses: vmactions/freebsd-vm@v1 + with: + release: ${{ matrix.version }} + usesh: true + prepare: | + pkg install -y python3 bash cmake git gmake gsed libpcap tcpreplay + + run: | + echo "Building PcapPlusPlus" + chmod a+rw /dev/bpf* + cmake -S . -B Dist + cmake --build Dist -j$(sysctl -n hw.ncpu) + + echo "Setting up the network interface for the tests" + # Get the first interface name that is not 'lo' + interface_name=$(ifconfig -l | tr ' ' '\n' | grep -v '^lo' | head -n 1) + ifconfig "$interface_name" promisc + + echo "Testing PcapPlusPlus" + python3 -m ensurepip + python3 -m pip install -r ci/run_tests/requirements.txt + python3 ci/run_tests/run_tests.py --interface "$interface_name" + + echo "Testing PcapPlusPlus examples" + cd Tests/ExamplesTest + python3 -m ensurepip + python3 -m pip install -r requirements.txt + python3 -m pytest --interface "$interface_name" --root-path=../../Dist/examples_bin + android: strategy: matrix: diff --git a/README.md b/README.md index 5b06b28e93..978d970b4e 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@ [![PcapPlusPlus Logo](https://pcapplusplus.github.io/img/logo/logo_color.png)](https://pcapplusplus.github.io) [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/seladb/PcapPlusPlus/build_and_test.yml?branch=master&label=Actions&logo=github&style=flat)](https://github.com/seladb/PcapPlusPlus/actions?query=workflow%3A%22Build+and+test%22) -[![Cirrus CI - Base Branch Build Status](https://img.shields.io/cirrus/github/seladb/PcapPlusPlus?label=Cirrus%20CI&logo=cirrusci&style=flat)](https://cirrus-ci.com/github/seladb/PcapPlusPlus) [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/seladb/PcapPlusPlus/codeql.yml?branch=master&label=CodeQL&logo=github&style=flat)](https://github.com/seladb/PcapPlusPlus/actions?query=workflow%3A%22CodeQL%22) [![Codecov](https://img.shields.io/codecov/c/github/seladb/PcapPlusPlus?logo=codecov&logoColor=white)](https://app.codecov.io/github/seladb/PcapPlusPlus) [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/seladb/PcapPlusPlus/badge)](https://scorecard.dev/viewer/?uri=github.com/seladb/PcapPlusPlus)