diff --git a/.github/workflows/kernel-build.yml b/.github/workflows/kernel-build.yml index ae73efe..b244d3e 100644 --- a/.github/workflows/kernel-build.yml +++ b/.github/workflows/kernel-build.yml @@ -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: master - - 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: @@ -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 diff --git a/.github/workflows/kernel-test.yml b/.github/workflows/kernel-test.yml index f3a3b74..f14c3dc 100644 --- a/.github/workflows/kernel-test.yml +++ b/.github/workflows/kernel-test.yml @@ -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 }} diff --git a/ci/vmtest/configs/run-vmtest.env b/ci/vmtest/configs/run-vmtest.env new file mode 100644 index 0000000..c60f1db --- /dev/null +++ b/ci/vmtest/configs/run-vmtest.env @@ -0,0 +1,42 @@ +#!/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. + +# $SELFTESTS_BPF and $VMTEST_CONFIGS are set in the workflow, before +# libbpf/ci/run-vmtest action is called +# See .github/workflows/kernel-test.yml + +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[*]}") +