Skip to content

[WIP] Use IPDK-container to speed-up the DPDK-PTF CI #1

[WIP] Use IPDK-container to speed-up the DPDK-PTF CI

[WIP] Use IPDK-container to speed-up the DPDK-PTF CI #1

name: "p4c-dpdk-ptf-p4testgen-tests"
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
# If workflow for PR or push is already running stop it, and start new one.
group: p4c_dpdk_ptf_ci-${{ github.ref }}
cancel-in-progress: true
jobs:
build_p4dpdk_ubuntu:
runs-on: ubuntu-22.04
steps:
# TODO: Cache for container
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ptf-${{ runner.os }}-test
max-size: 1000M
- name: Checkout P4C
uses: actions/checkout@v3
with:
path: p4c
submodules: recursive
- name: Checkout DPDK-target
uses: actions/checkout@v3
with:
repository: p4lang/p4-dpdk-target
path: p4sde
submodules: recursive
- name: Build IPDK
run: |
cp p4c/tools/dpdk_ptf.Dockerfile .
docker build -t dpdk_ptf -f dpdk_ptf.Dockerfile .
# hugepage has to be set in the same shell session
- name: Run DPDK PTF tests using P4Testgen
run: |
sudo -E docker run --privileged -w /root/p4c/build dpdk_ptf bash -c "../../scripts/set_hugepages.sh && ctest -j1 --output-on-failure -R testgen-p4c-pna-ptf"
rm -rf ./.ccache
docker cp $(docker create --rm dpdk_ptf):/root/.ccache .