ci: switch to libbpf/ci/build-selftests action

Signed-off-by: Ihor Solodrai <ihor.solodrai@pm.me>
This commit is contained in:
Ihor Solodrai
2024-11-12 13:43:31 -08:00
committed by Andrii Nakryiko
parent a453ffb7ea
commit dcf6ad6c70
3 changed files with 78 additions and 32 deletions

View File

@@ -0,0 +1,8 @@
#!/bin/bash
set -euo pipefail
cd "${SELFTESTS_BPF}"
printf "all:\n\ttouch bpf_testmod.ko\n\nclean:\n" > bpf_testmod/Makefile
printf "all:\n\ttouch bpf_test_no_cfi.ko\n\nclean:\n" > bpf_test_no_cfi/Makefile

View File

@@ -0,0 +1,41 @@
#!/bin/bash
set -euo pipefail
function append_into() {
local out="$1"
shift
local files=("$@")
echo -n > "$out"
for file in "${files[@]}"; do
cat "$file" >> "$out" || true
done
}
allowlists=(
"${SELFTESTS_BPF}/ALLOWLIST"
"${SELFTESTS_BPF}/ALLOWLIST.${ARCH}"
"${VMTEST_CONFIGS}/ALLOWLIST"
"${VMTEST_CONFIGS}/ALLOWLIST-${KERNEL}"
"${VMTEST_CONFIGS}/ALLOWLIST-${KERNEL}.${ARCH}"
)
append_into "${ALLOWLIST_FILE}" "${allowlists[@]}"
denylists=(
"${SELFTESTS_BPF}/DENYLIST"
"${SELFTESTS_BPF}/DENYLIST.${ARCH}"
"${VMTEST_CONFIGS}/DENYLIST"
"${VMTEST_CONFIGS}/DENYLIST-${KERNEL}"
"${VMTEST_CONFIGS}/DENYLIST-${KERNEL}.${ARCH}"
)
append_into "${DENYLIST_FILE}" "${denylists[@]}"
if [[ "${KERNEL}" == "5.5.0" ]]; then
echo "KERNEL_TEST=test_progs test_progs_no_alu32" >> $GITHUB_ENV
fi
mkdir "${GITHUB_WORKSPACE}/selftests"
cp -R "${SELFTESTS_BPF}" "${GITHUB_WORKSPACE}/selftests"