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

support ubuntu 24 in CI #1486

Merged
merged 34 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
1ee855f
support ubuntu24
tigercosmos Jul 6, 2024
f3edb1a
Merge branch 'dev' into ubuntu24
tigercosmos Jul 6, 2024
ed212f4
test
tigercosmos Jul 6, 2024
ed73da0
update
tigercosmos Jul 6, 2024
65dc067
update
tigercosmos Jul 6, 2024
800d192
try
tigercosmos Jul 6, 2024
4600133
test
tigercosmos Jul 7, 2024
8054c90
try
tigercosmos Jul 7, 2024
a7603f0
test
tigercosmos Jul 7, 2024
ab07076
use bash for linux
tigercosmos Jul 7, 2024
2868ccf
test
tigercosmos Jul 7, 2024
ce005bd
test
tigercosmos Jul 7, 2024
7d3d143
try
tigercosmos Jul 7, 2024
4a7f697
try
tigercosmos Jul 7, 2024
4f4147f
replace netifaces by psutil
zhengfeihe Jul 7, 2024
e39de2b
Update ci/run_tests/requirements.txt
tigercosmos Jul 7, 2024
5f80c36
temporarily disable other tests
tigercosmos Jul 7, 2024
8541ce1
test
tigercosmos Jul 7, 2024
2241be8
format code
zhengfeihe Jul 7, 2024
84245b7
Merge branch '1489' into ubuntu24
tigercosmos Jun 23, 2024
6d31da5
test
tigercosmos Jul 7, 2024
a5f2dac
Revert "temporarily disable other tests"
tigercosmos Jun 23, 2024
7b18e8b
try activate venv for pre-commit
tigercosmos Jul 18, 2024
5ea9c4f
Revert "try activate venv for pre-commit"
tigercosmos Jul 19, 2024
9963098
Merge remote-tracking branch 'upstream/dev' into ubuntu24
tigercosmos Aug 16, 2024
bd3ce12
update
tigercosmos Aug 16, 2024
a853f08
python3
tigercosmos Aug 16, 2024
10b4866
Merge branch 'dev' into ubuntu24
tigercosmos Aug 16, 2024
5828da4
try
tigercosmos Aug 16, 2024
04a2216
Merge branch 'ubuntu24' of github.com:tigercosmos/PcapPlusPlus into u…
tigercosmos Aug 16, 2024
167664d
add "Prepare environment for tests" step
tigercosmos Aug 19, 2024
4f3dc32
fix
tigercosmos Aug 19, 2024
2b4ac4e
fix
tigercosmos Aug 19, 2024
f3ed6b2
add a comment
tigercosmos Aug 19, 2024
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
52 changes: 31 additions & 21 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
apk update && apk add cppcheck python3-dev
python3 -m pip install cmake-format clang-format==18.1.6

# TODO: investigate how to run pre-commit with `venv`
Copy link
Collaborator

@egecetin egecetin Aug 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related with this PR directly but, it is possible to use pre-commit.ci but we should remove cppcheck and clang-format from pre-commit since they require pre-installed binaries.

- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
tigercosmos marked this conversation as resolved.
Show resolved Hide resolved

- name: CMake format
Expand All @@ -52,29 +53,24 @@ jobs:
container: seladb/${{ matrix.image }}
strategy:
matrix:
include:
include: # Check the images at https://github.com/seladb/PcapPlusPlus-DockerImages
- image: ubuntu2404
config-zstd: OFF
- image: ubuntu2204
python: python3
config-zstd: OFF
- image: ubuntu2204-icpx
python: python3
config-zstd: OFF
additional-flags: -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx
additional-gcov-flags: --gcov-executable "llvm-cov gcov"
- image: ubuntu2004
python: python3
config-zstd: OFF
- image: rhel94
python: python3
config-zstd: OFF
- image: ubuntu2004-zstd
python: python3
config-zstd: ON
- image: fedora39
python: python3
config-zstd: OFF
- image: alpine317
python: python3
config-zstd: OFF

steps:
Expand Down Expand Up @@ -109,18 +105,23 @@ jobs:
- name: Build PcapPlusPlus
run: cmake --build "$BUILD_DIR" -j

- name: Prepare environment for tests
run: |
python3 -m venv ./venv
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Maybe move this line to it's own step? It looks weird to me that the venv is created inside the 'Test PCPP' step but the following steps also depend on it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Moved it to a step.

. ./venv/bin/activate
python3 -m pip install -r ci/run_tests/requirements.txt

- name: Test PcapPlusPlus
run: |
${{ matrix.python }} -m pip install -U pip
${{ matrix.python }} -m pip install -r ci/run_tests/requirements.txt
${{ matrix.python }} ci/run_tests/run_tests.py --interface eth0 ${{ matrix.test-flags }}
. ./venv/bin/activate
python3 ci/run_tests/run_tests.py --interface eth0 ${{ matrix.test-flags }}

- name: Test Examples
run: |
. ./venv/bin/activate
cd Tests/ExamplesTest
${{ matrix.python }} -m pip install -U pip
${{ matrix.python }} -m pip install -r requirements.txt
${{ matrix.python }} -m pytest --interface eth0 --root-path=../../Dist/examples_bin
python3 -m pip install -r requirements.txt
python3 -m pytest --interface eth0 --root-path=../../Dist/examples_bin

- name: Check installation
run: |
Expand All @@ -138,7 +139,8 @@ jobs:

- name: Create Cobertura Report
run: |
${{ matrix.python }} -m pip install gcovr
. ./venv/bin/activate
python3 -m pip install gcovr
gcovr -v -r . ${{ matrix.additional-gcov-flags }} $GCOVR_FLAGS -o coverage.xml

- name: Upload Coverage Results
Expand Down Expand Up @@ -343,19 +345,23 @@ jobs:
- name: Check architecture
run: lipo $BUILD_DIR/Pcap++/libPcap++.a -verify_arch ${{ matrix.arch }}

- name: Prepare environment for tests
run: |
python -m venv ./venv
. ./venv/bin/activate
python -m pip install -r ci/run_tests/requirements.txt

- name: Test PcapPlusPlus
# We can't run cross compiled binaries
if: ${{ matrix.host-arch == matrix.arch }}
run: |
python -m pip install -U pip
python -m pip install -r ci/run_tests/requirements.txt
. ./venv/bin/activate
python ci/run_tests/run_tests.py --interface en0

- name: Test Examples
if: ${{ matrix.host-arch == matrix.arch }}
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

Expand Down Expand Up @@ -605,7 +611,6 @@ jobs:

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

Expand Down Expand Up @@ -709,10 +714,15 @@ jobs:
- name: Build PcapPlusPlus
run: cmake --build $BUILD_DIR -j

- name: Test PcapPlusPlus
- name: Prepare environment for tests
run: |
python -m pip install -U pip
python -m venv ./venv
. ./venv/bin/activate
python -m pip install -r ci/run_tests/requirements.txt

- name: Test PcapPlusPlus
run: |
. ./venv/bin/activate
python ci/run_tests/run_tests.py --interface eth0 --use-sudo --pcap-test-args="-t xdp"

- name: Create Cobertura Report
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
strategy:
matrix:
include:
- image: ubuntu2404
config-zstd: OFF
- image: ubuntu2204
config-zstd: OFF
- image: ubuntu2204-icpx
Expand Down
Loading