From 181ea6c93d75858f168de5b321670c5e3e8f5726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20Lothor=C3=A9?= Date: Tue, 18 Aug 2026 16:37:01 +0200 Subject: [PATCH] workflows: add a composite action to execute bpftool build tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The kernel bpf selftest include the test_bpftool_build.sh script, that ensures that all supported ways of building bpftool still work as expected. Add a dedicated action to allow executing this script in CI. Signed-off-by: Alexis Lothoré --- build-bpftool/action.yml | 16 ++++++++++++++++ build-bpftool/build_bpftool.sh | 23 +++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 build-bpftool/action.yml create mode 100755 build-bpftool/build_bpftool.sh diff --git a/build-bpftool/action.yml b/build-bpftool/action.yml new file mode 100644 index 0000000..7fab576 --- /dev/null +++ b/build-bpftool/action.yml @@ -0,0 +1,16 @@ +name: 'Test bpftool build' +description: 'Run test_bpftool_build.sh to exercise the various ways of building bpftool' +inputs: + kernel-root: + description: 'Path to the root of the kernel source tree' + required: true + +runs: + using: "composite" + steps: + - name: Test bpftool build + shell: bash + run: + ${GITHUB_ACTION_PATH}/build_bpftool.sh "${{ inputs.kernel-root }}" + env: + MAX_MAKE_JOBS: ${{ inputs.max-make-jobs }} diff --git a/build-bpftool/build_bpftool.sh b/build-bpftool/build_bpftool.sh new file mode 100755 index 0000000..59abe43 --- /dev/null +++ b/build-bpftool/build_bpftool.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -euo pipefail + +THISDIR="$(cd $(dirname $0) && pwd)" + +source "${THISDIR}"/../helpers.sh + +KERNEL_ROOT="$(realpath $1)" + +foldable start build_bpftool "Testing bpftool build" + +# The action builds everything in tools/bpf; that includes bpf_dbg, which +# depends on readline +sudo -E apt-get install --no-install-recommends -y \ + libreadline-dev + +cd "${KERNEL_ROOT}" + +unset CROSS_COMPILE +bash tools/testing/selftests/bpf/test_bpftool_build.sh -j "$(kernel_build_make_jobs)" + +foldable end build_bpftool