support ubuntu 24 in CI #4782
Workflow file for this run
This file contains 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: Build and test | |
on: | |
push: | |
branches: ["master", "dev"] | |
pull_request: | |
branches: ["dev"] | |
schedule: | |
- cron: '0 0 * * 0' # Run every Sunday at midnight | |
env: | |
BUILD_DIR: Dist | |
GCOVR_FLAGS: --gcov-ignore-parse-errors --exclude-throw-branches --filter Common --filter Pcap --filter Packet --xml | |
permissions: | |
contents: read | |
jobs: | |
linux: | |
runs-on: ubuntu-latest | |
container: seladb/${{ matrix.image }} | |
strategy: | |
matrix: | |
include: | |
- image: ubuntu2404 | |
python: python3 | |
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: | |
- name: Checkout code | |
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | |
- name: Set up Python | |
run: | | |
if [ "${{ matrix.image }}" = "alpine317" ]; then | |
apk add python3 py3-virtualenv py3-virtualenv python3-dev | |
elif [ "${{ matrix.image }}" = "rhel94" ]; then | |
yum install -y python3 python3-virtualenv python3-devel | |
elif [ "${{ matrix.image }}" = "fedora39" ]; then | |
dnf install -y python3 python3-virtualenv python3-devel | |
else | |
apt-get update | |
apt-get install -y python3 python3-venv python3-dev | |
fi | |
# Checkout is performed out of the container and doesn't match our user | |
- name: Fix checkout ownership | |
run: chown -R "$(id -u):$(id -g)" "$GITHUB_WORKSPACE" | |
- name: Setup Intel Compiler variables | |
if: contains(matrix.image, 'icpx') | |
run: | | |
. /opt/intel/oneapi/setvars.sh | |
printenv >> $GITHUB_ENV | |
- name: Configure PcapPlusPlus | |
run: cmake -DLIGHT_PCAPNG_ZSTD=${{ matrix.config-zstd }} -DPCAPPP_BUILD_COVERAGE=ON ${{ matrix.additional-flags }} -S . -B "$BUILD_DIR" | |
- name: Build PcapPlusPlus | |
run: cmake --build "$BUILD_DIR" -j | |
- name: Test PcapPlusPlus | |
shell: bash | |
run: | | |
${{ matrix.python }} -m venv ./venv | |
source ./venv/bin/activate | |
${{ matrix.python }} -m pip install 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 }} | |
- name: Test Examples | |
shell: bash | |
run: | | |
source ./venv/bin/activate | |
cd Tests/ExamplesTest | |
${{ matrix.python }} -m pip install -r requirements.txt | |
${{ matrix.python }} -m pytest --interface eth0 --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: | | |
cmake -DPCAPPP_BUILD_TUTORIALS=ON ${{ matrix.additional-flags }} -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 | |
shell: bash | |
run: | | |
source ./venv/bin/activate | |
${{ matrix.python }} -m pip install gcovr | |
gcovr -v -r . ${{ matrix.additional-gcov-flags }} $GCOVR_FLAGS -o coverage.xml | |
- name: Upload Coverage Results | |
uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # v3.1.6 | |
with: | |
files: ./coverage.xml | |
flags: ${{ matrix.image }},unittest | |
fail_ci_if_error: false | |
verbose: true | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |