Skip to content

Commit

Permalink
Create new test runner for tofino backend
Browse files Browse the repository at this point in the history
Co-authored-by: Glen Gibb <[email protected]>
Co-authored-by: Prathima Kotikalapudi <[email protected]>
Co-authored-by: Han Wang <[email protected]>
  • Loading branch information
4 people committed Oct 23, 2024
1 parent 047d49e commit d82ec3d
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 2 deletions.
34 changes: 33 additions & 1 deletion .github/workflows/ci-test-debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
CTEST_PARALLEL_LEVEL: 4
IMAGE_TYPE: test
BUILD_GENERATOR: Ninja
ENABLE_TOFINO: ON
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -43,6 +42,39 @@ jobs:
run: sudo -E ctest --output-on-failure --schedule-random
working-directory: ./build

# Build with GCC and test Tofino backend on Ubuntu 22.04.
test-ubuntu22-tofino:
runs-on: ubuntu-22.04
env:
CTEST_PARALLEL_LEVEL: 4
IMAGE_TYPE: test
BUILD_GENERATOR: Ninja
ENABLE_GTESTS: ON
ENABLE_TOFINO: ON
ENABLE_BMV2: OFF
ENABLE_EBPF: OFF
ENABLE_UBPF: OFF
ENABLE_DPDK: OFF
ENABLE_P4TC: OFF
ENABLE_P4FMT: OFF
ENABLE_P4TEST: OFF
ENABLE_P4C_GRAPHS: OFF
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: test-${{ runner.os }}-gcc
max-size: 1000M

- name: Build (Ubuntu 22.04, GCC)
run: |
tools/ci-build.sh
# Build with GCC and test P4C on Ubuntu 20.04.
test-ubuntu20:
name: test-ubuntu20 (Unity ${{ matrix.unity }}, GTest ${{ matrix.gtest }})
Expand Down
29 changes: 28 additions & 1 deletion tools/ci-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,34 @@ CMAKE_FLAGS+="-DENABLE_SANITIZERS=${ENABLE_SANITIZERS} "
# Enable auto var initialization with pattern.
CMAKE_FLAGS+="-DBUILD_AUTO_VAR_INIT_PATTERN=${BUILD_AUTO_VAR_INIT_PATTERN} "
# Enable Tofino.
CMAKE_FLAGS+="-DENABLE_TOFINO=${ENABLE_TOFINO} "
if [ -n "${ENABLE_TOFINO}" ]; then
CMAKE_FLAGS+="-DENABLE_TOFINO=${ENABLE_TOFINO} "
fi
if [ -n "${ENABLE_BMV2}" ]; then
CMAKE_FLAGS+="-DENABLE_BMV2=${ENABLE_BMV2} "
fi
if [ -n "${ENABLE_EBPF}" ]; then
CMAKE_FLAGS+="-DENABLE_EBPF=${ENABLE_EBPF} "
fi
if [ -n "${ENABLE_UBPF}" ]; then
CMAKE_FLAGS+="-DENABLE_UBPF=${ENABLE_UBPF} "
fi
if [ -n "${ENABLE_DPDK}" ]; then
CMAKE_FLAGS+="-DENABLE_DPDK=${ENABLE_DPDK} "
fi
if [ -n "${ENABLE_P4TC}" ]; then
CMAKE_FLAGS+="-DENABLE_P4TC=${ENABLE_P4TC} "
fi
if [ -n "${ENABLE_P4FMT}" ]; then
CMAKE_FLAGS+="-DENABLE_P4FMT=${ENABLE_P4FMT} "
fi
if [ -n "${ENABLE_P4TEST}" ]; then
CMAKE_FLAGS+="-DENABLE_P4TEST=${ENABLE_P4TEST} "
fi
if [ -n "${ENABLE_P4C_GRAPHS}" ]; then
CMAKE_FLAGS+="-DENABLE_P4C_GRAPHS=${ENABLE_P4C_GRAPHS} "
fi


if [ "$ENABLE_SANITIZERS" == "ON" ]; then
CMAKE_FLAGS+="-DENABLE_GC=OFF"
Expand Down

0 comments on commit d82ec3d

Please sign in to comment.