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