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

Refactor GitHub Action to build and test the BESS image #47

Merged
merged 1 commit into from
Mar 7, 2024
Merged
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
66 changes: 37 additions & 29 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,47 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2022-Present Intel Corporation

name: Build and Test process
name: Build and Test
on:
- pull_request
env:
BESS_DPDK_BRANCH: master
pull_request:
branches:
- master
push:

jobs:
build:
runs-on: ubuntu-20.04
Copy link
Contributor

Choose a reason for hiding this comment

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

why this old ubuntu?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am using this version because of the version that is being currently used in BESS. I have a couple more PRs coming after this one is merged about updating dependencies and I was planning to align the Ubuntu versions in the PR where I refactor the Dockerfile

steps:
- uses: actions/checkout@v4
- run: sudo sysctl -w vm.nr_hugepages=512
- run: sudo apt-get update
- run: sudo apt-get install -y python3-pip python3-setuptools python3-coverage python3-pyelftools ccache
- run: sudo pip3 install -r requirements.txt
- run: '[[ ${COVERAGE:-0} == 0 ]] || sudo apt-get install -y gcc-7'
- run: '[[ ${SANITIZE:-0} == 0 ]] || sudo apt-get install -y llvm-3.9'
- name: Install CNDP packages

- name: Setup environment
run: |
wget https://raw.githubusercontent.com/DPDK/dpdk/main/usertools/dpdk-hugepages.py -O dpdk-hugepages.py
thakurajayL marked this conversation as resolved.
Show resolved Hide resolved
chmod +x dpdk-hugepages.py
sudo mkdir -p /dev/hugepages
sudo ./dpdk-hugepages.py -p 1G --setup 8G

- name: Setup dependencies
run: |
sudo apt-get install -y ccache libbpf0
sudo pip3 install -r requirements.txt
yes n | ./env/rebuild_images.py focal64
sudo mkdir -p /mnt/huge
sudo mount -t hugetlbfs nodev /mnt/huge
export CXX="ccache $VER_CXX"
ccache -s

- name: Build BESS
run: |
sudo ./container_build.py bess
sudo ./container_build.py kmod_buildtest

- name: Test BESS
run: |
sudo apt-get update && sudo apt-get install -y \
build-essential libbsd-dev libelf-dev libbpf-dev libjson-c-dev \
libnl-3-dev libnl-cli-3-dev libnuma-dev libpcap-dev meson \
pkg-config libgflags2.2
- run: yes n | ./env/rebuild_images.py focal64
- run: sudo mkdir -p /mnt/huge
- run: sudo mount -t hugetlbfs nodev /mnt/huge
- run: export CXX="ccache $VER_CXX"
- run: ccache -s
- run: sudo ./container_build.py bess
- run: sudo ./container_build.py kmod_buildtest
- run: (cd core && ./all_test --gtest_shuffle)
- run: python3-coverage run -m unittest discover -v
- run: python3 bessctl/run_module_tests.py
- run: sudo python3 bessctl/run_module_tests.py --test_dir bessctl/module_tests/cndp
- run: ccache -s
- run: bessctl/bessctl daemon stop
- run: '[[ ${COVERAGE:-0} == 0 ]] || { sleep 3; codecov --gcov-exec gcov-7; }'
(cd core && ./all_test --gtest_shuffle)
coverage run -m unittest discover -v
python3 bessctl/run_module_tests.py
sudo python3 bessctl/run_module_tests.py --test_dir bessctl/module_tests/cndp
ccache -s
bessctl/bessctl daemon stop
[[ ${COVERAGE:-0} == 0 ]] || { sleep 3; codecov --gcov-exec gcov-7; }
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
scapy
flask
coverage
grpcio
protobuf==3.20
pyroute2
scapy