Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
theihor committed Jan 10, 2025
1 parent e598660 commit cb04127
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 27 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/kernel-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,14 @@ jobs:
with:
patches-root: '${{ github.workspace }}/ci/diffs'
repo-root: ${{ env.REPO_ROOT }}

- name: Setup build environment
uses: libbpf/ci/setup-build-env@v2
with:
arch: ${{ inputs.arch }}
llvm-version: ${{ inputs.llvm-version }}
pahole: 1cb4202ed2cbd591734f6b7fb1d2b8aa8eb5a1c3 # v1.28
- name: Print toolchain version used
shell: bash
run: |
TOOLCHAIN=${{ inputs.toolchain }}
if [ $TOOLCHAIN = "llvm" ]; then
TOOLCHAIN="clang-${{ inputs.llvm-version }}"
fi
${TOOLCHAIN} --version

- name: Build kernel image
uses: libbpf/ci/build-linux@v2
with:
Expand Down Expand Up @@ -133,6 +127,7 @@ jobs:
toolchain: ${{ inputs.toolchain }}
llvm-version: ${{ inputs.llvm-version }}
max-make-jobs: 32

- if: ${{ github.event_name != 'push' }}
name: Build samples
uses: libbpf/ci/build-samples@v2
Expand Down
25 changes: 6 additions & 19 deletions .github/workflows/kernel-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,31 +64,18 @@ jobs:
# zstd is installed by default in the runner images.
run: zstd -d -T0 vmlinux-${{ inputs.arch }}-${{ inputs.toolchain_full }}.tar.zst --stdout | tar -xf -

- name: Prepare ALLOW/DENYLIST
env:
SELFTESTS_BPF: ${{ github.workspace }}/selftests/bpf
VMTEST_CONFIGS: ${{ github.workspace }}/ci/vmtest/configs
run: |
cat "${SELFTESTS_BPF}/ALLOWLIST" \
"${SELFTESTS_BPF}/ALLOWLIST.${ARCH}" \
"${VMTEST_CONFIGS}/ALLOWLIST" \
"${VMTEST_CONFIGS}/ALLOWLIST.${ARCH}" \
2> /dev/null > "${ALLOWLIST_FILE}" || true
cat "${SELFTESTS_BPF}/DENYLIST" \
"${SELFTESTS_BPF}/DENYLIST.${ARCH}" \
"${VMTEST_CONFIGS}/DENYLIST" \
"${VMTEST_CONFIGS}/DENYLIST.${ARCH}" \
"${VMTEST_CONFIGS}/DENYLIST.${DEPLOYMENT}" \
2> /dev/null > "${DENYLIST_FILE}" || true
- name: Run selftests
uses: libbpf/ci/run-vmtest@v2
uses: theihor/libbpf-ci/run-vmtest@run-vmtest-update
# https://github.com/actions/runner/issues/1483#issuecomment-1031671517
# booleans are weird in GH.
continue-on-error: ${{ fromJSON(env.CONTINUE_ON_ERROR) }}
timeout-minutes: ${{ inputs.timeout_minutes }}
env:
ARCH: ${{ inputs.arch }}
DEPLOYMENT: ${{ env.DEPLOYMENT }}
KERNEL_TEST: ${{ inputs.test }}
SELFTESTS_BPF: ${{ github.workspace }}/selftests/bpf
VMTEST_CONFIGS: ${{ github.workspace }}/ci/vmtest/configs
TEST_PROGS_WATCHDOG_TIMEOUT: 300
with:
arch: ${{ inputs.arch }}
Expand Down
38 changes: 38 additions & 0 deletions ci/vmtest/configs/run-vmtest.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

# This file is sourced by libbpf/ci/run-vmtest Github Action scripts.
#
# The primary reason it exists is that assembling ALLOWLIST and
# DENYLIST for a particular test run is not a trivial operation.
#
# Users of libbpf/ci/run-vmtest action need to be able to specify a
# list of allow/denylist **files**, that later has to be correctly
# merged into a single allow/denylist passed to a test runner.
#
# Obviously it's perferrable for the scripts merging many lists into
# one to be reusable, and not copy-pasted between repositories which
# use libbpf/ci actions. And specifying the lists should be trivial.
# This file is a solution to that.

ALLOWLIST_FILES=(
"${SELFTESTS_BPF}/ALLOWLIST"
"${SELFTESTS_BPF}/ALLOWLIST.${ARCH}"
"${VMTEST_CONFIGS}/ALLOWLIST"
"${VMTEST_CONFIGS}/ALLOWLIST.${ARCH}"
"${VMTEST_CONFIGS}/ALLOWLIST.${DEPLOYMENT}"
"${VMTEST_CONFIGS}/ALLOWLIST.${KERNEL_TEST}"
)

DENYLIST_FILES=(
"${SELFTESTS_BPF}/DENYLIST"
"${SELFTESTS_BPF}/DENYLIST.${ARCH}"
"${VMTEST_CONFIGS}/DENYLIST"
"${VMTEST_CONFIGS}/DENYLIST.${ARCH}"
"${VMTEST_CONFIGS}/DENYLIST.${DEPLOYMENT}"
"${VMTEST_CONFIGS}/DENYLIST.${KERNEL_TEST}"
)

# Export pipe-separated strings, because bash doesn't support array export
export SELFTESTS_BPF_ALLOWLIST_FILES=$(IFS="|"; echo "${ALLOWLIST_FILES[*]}")
export SELFTESTS_BPF_DENYLIST_FILES=$(IFS="|"; echo "${DENYLIST_FILES[*]}")

0 comments on commit cb04127

Please sign in to comment.