Skip to content

Commit cb04127

Browse files
committed
1 parent e598660 commit cb04127

File tree

3 files changed

+47
-27
lines changed

3 files changed

+47
-27
lines changed

.github/workflows/kernel-build.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,14 @@ jobs:
9090
with:
9191
patches-root: '${{ github.workspace }}/ci/diffs'
9292
repo-root: ${{ env.REPO_ROOT }}
93+
9394
- name: Setup build environment
9495
uses: libbpf/ci/setup-build-env@v2
9596
with:
9697
arch: ${{ inputs.arch }}
9798
llvm-version: ${{ inputs.llvm-version }}
9899
pahole: 1cb4202ed2cbd591734f6b7fb1d2b8aa8eb5a1c3 # v1.28
99-
- name: Print toolchain version used
100-
shell: bash
101-
run: |
102-
TOOLCHAIN=${{ inputs.toolchain }}
103-
if [ $TOOLCHAIN = "llvm" ]; then
104-
TOOLCHAIN="clang-${{ inputs.llvm-version }}"
105-
fi
106-
${TOOLCHAIN} --version
100+
107101
- name: Build kernel image
108102
uses: libbpf/ci/build-linux@v2
109103
with:
@@ -133,6 +127,7 @@ jobs:
133127
toolchain: ${{ inputs.toolchain }}
134128
llvm-version: ${{ inputs.llvm-version }}
135129
max-make-jobs: 32
130+
136131
- if: ${{ github.event_name != 'push' }}
137132
name: Build samples
138133
uses: libbpf/ci/build-samples@v2

.github/workflows/kernel-test.yml

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -64,31 +64,18 @@ jobs:
6464
# zstd is installed by default in the runner images.
6565
run: zstd -d -T0 vmlinux-${{ inputs.arch }}-${{ inputs.toolchain_full }}.tar.zst --stdout | tar -xf -
6666

67-
- name: Prepare ALLOW/DENYLIST
68-
env:
69-
SELFTESTS_BPF: ${{ github.workspace }}/selftests/bpf
70-
VMTEST_CONFIGS: ${{ github.workspace }}/ci/vmtest/configs
71-
run: |
72-
cat "${SELFTESTS_BPF}/ALLOWLIST" \
73-
"${SELFTESTS_BPF}/ALLOWLIST.${ARCH}" \
74-
"${VMTEST_CONFIGS}/ALLOWLIST" \
75-
"${VMTEST_CONFIGS}/ALLOWLIST.${ARCH}" \
76-
2> /dev/null > "${ALLOWLIST_FILE}" || true
77-
78-
cat "${SELFTESTS_BPF}/DENYLIST" \
79-
"${SELFTESTS_BPF}/DENYLIST.${ARCH}" \
80-
"${VMTEST_CONFIGS}/DENYLIST" \
81-
"${VMTEST_CONFIGS}/DENYLIST.${ARCH}" \
82-
"${VMTEST_CONFIGS}/DENYLIST.${DEPLOYMENT}" \
83-
2> /dev/null > "${DENYLIST_FILE}" || true
84-
8567
- name: Run selftests
86-
uses: libbpf/ci/run-vmtest@v2
68+
uses: theihor/libbpf-ci/run-vmtest@run-vmtest-update
8769
# https://github.com/actions/runner/issues/1483#issuecomment-1031671517
8870
# booleans are weird in GH.
8971
continue-on-error: ${{ fromJSON(env.CONTINUE_ON_ERROR) }}
9072
timeout-minutes: ${{ inputs.timeout_minutes }}
9173
env:
74+
ARCH: ${{ inputs.arch }}
75+
DEPLOYMENT: ${{ env.DEPLOYMENT }}
76+
KERNEL_TEST: ${{ inputs.test }}
77+
SELFTESTS_BPF: ${{ github.workspace }}/selftests/bpf
78+
VMTEST_CONFIGS: ${{ github.workspace }}/ci/vmtest/configs
9279
TEST_PROGS_WATCHDOG_TIMEOUT: 300
9380
with:
9481
arch: ${{ inputs.arch }}

ci/vmtest/configs/run-vmtest.env

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
# This file is sourced by libbpf/ci/run-vmtest Github Action scripts.
4+
#
5+
# The primary reason it exists is that assembling ALLOWLIST and
6+
# DENYLIST for a particular test run is not a trivial operation.
7+
#
8+
# Users of libbpf/ci/run-vmtest action need to be able to specify a
9+
# list of allow/denylist **files**, that later has to be correctly
10+
# merged into a single allow/denylist passed to a test runner.
11+
#
12+
# Obviously it's perferrable for the scripts merging many lists into
13+
# one to be reusable, and not copy-pasted between repositories which
14+
# use libbpf/ci actions. And specifying the lists should be trivial.
15+
# This file is a solution to that.
16+
17+
ALLOWLIST_FILES=(
18+
"${SELFTESTS_BPF}/ALLOWLIST"
19+
"${SELFTESTS_BPF}/ALLOWLIST.${ARCH}"
20+
"${VMTEST_CONFIGS}/ALLOWLIST"
21+
"${VMTEST_CONFIGS}/ALLOWLIST.${ARCH}"
22+
"${VMTEST_CONFIGS}/ALLOWLIST.${DEPLOYMENT}"
23+
"${VMTEST_CONFIGS}/ALLOWLIST.${KERNEL_TEST}"
24+
)
25+
26+
DENYLIST_FILES=(
27+
"${SELFTESTS_BPF}/DENYLIST"
28+
"${SELFTESTS_BPF}/DENYLIST.${ARCH}"
29+
"${VMTEST_CONFIGS}/DENYLIST"
30+
"${VMTEST_CONFIGS}/DENYLIST.${ARCH}"
31+
"${VMTEST_CONFIGS}/DENYLIST.${DEPLOYMENT}"
32+
"${VMTEST_CONFIGS}/DENYLIST.${KERNEL_TEST}"
33+
)
34+
35+
# Export pipe-separated strings, because bash doesn't support array export
36+
export SELFTESTS_BPF_ALLOWLIST_FILES=$(IFS="|"; echo "${ALLOWLIST_FILES[*]}")
37+
export SELFTESTS_BPF_DENYLIST_FILES=$(IFS="|"; echo "${DENYLIST_FILES[*]}")
38+

0 commit comments

Comments
 (0)