Skip to content

Commit 181ea6c

Browse files
committed
workflows: add a composite action to execute bpftool build tests
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é <alexis.lothore@bootlin.com>
1 parent 6cdfb2d commit 181ea6c

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

build-bpftool/action.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: 'Test bpftool build'
2+
description: 'Run test_bpftool_build.sh to exercise the various ways of building bpftool'
3+
inputs:
4+
kernel-root:
5+
description: 'Path to the root of the kernel source tree'
6+
required: true
7+
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Test bpftool build
12+
shell: bash
13+
run:
14+
${GITHUB_ACTION_PATH}/build_bpftool.sh "${{ inputs.kernel-root }}"
15+
env:
16+
MAX_MAKE_JOBS: ${{ inputs.max-make-jobs }}

build-bpftool/build_bpftool.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
THISDIR="$(cd $(dirname $0) && pwd)"
6+
7+
source "${THISDIR}"/../helpers.sh
8+
9+
KERNEL_ROOT="$(realpath $1)"
10+
11+
foldable start build_bpftool "Testing bpftool build"
12+
13+
# The action builds everything in tools/bpf; that includes bpf_dbg, which
14+
# depends on readline
15+
sudo -E apt-get install --no-install-recommends -y \
16+
libreadline-dev
17+
18+
cd "${KERNEL_ROOT}"
19+
20+
unset CROSS_COMPILE
21+
bash tools/testing/selftests/bpf/test_bpftool_build.sh -j "$(kernel_build_make_jobs)"
22+
23+
foldable end build_bpftool

0 commit comments

Comments
 (0)