summaryrefslogtreecommitdiffstats
path: root/lib/libbpf/.github/actions/vmtest/action.yml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 07:10:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 07:10:00 +0000
commit4ba2b326284765e942044db13a7f0dae702bec93 (patch)
treecbdfaec33eed4f3a970c54cd10e8ddfe3003b3b1 /lib/libbpf/.github/actions/vmtest/action.yml
parentInitial commit. (diff)
downloadxdp-tools-4ba2b326284765e942044db13a7f0dae702bec93.tar.xz
xdp-tools-4ba2b326284765e942044db13a7f0dae702bec93.zip
Adding upstream version 1.3.1.upstream/1.3.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/libbpf/.github/actions/vmtest/action.yml')
-rw-r--r--lib/libbpf/.github/actions/vmtest/action.yml89
1 files changed, 89 insertions, 0 deletions
diff --git a/lib/libbpf/.github/actions/vmtest/action.yml b/lib/libbpf/.github/actions/vmtest/action.yml
new file mode 100644
index 0000000..e5f0722
--- /dev/null
+++ b/lib/libbpf/.github/actions/vmtest/action.yml
@@ -0,0 +1,89 @@
+name: 'vmtest'
+description: 'Build + run vmtest'
+inputs:
+ kernel:
+ description: 'kernel version or LATEST'
+ required: true
+ default: 'LATEST'
+ arch:
+ description: 'what arch to test'
+ required: true
+ default: 'x86_64'
+ pahole:
+ description: 'pahole rev or master'
+ required: true
+ default: 'master'
+runs:
+ using: "composite"
+ steps:
+ # setup environment
+ - name: Setup environment
+ uses: libbpf/ci/setup-build-env@master
+ with:
+ pahole: ${{ inputs.pahole }}
+ # 1. download CHECKPOINT kernel source
+ - name: Get checkpoint commit
+ shell: bash
+ run: |
+ cat CHECKPOINT-COMMIT
+ echo "CHECKPOINT=$(cat CHECKPOINT-COMMIT)" >> $GITHUB_ENV
+ - name: Get kernel source at checkpoint
+ uses: libbpf/ci/get-linux-source@master
+ with:
+ repo: 'https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git'
+ rev: ${{ env.CHECKPOINT }}
+ dest: '${{ github.workspace }}/.kernel'
+ - name: Patch kernel source
+ uses: libbpf/ci/patch-kernel@master
+ with:
+ patches-root: '${{ github.workspace }}/travis-ci/diffs'
+ repo-root: '.kernel'
+ - name: Prepare to build BPF selftests
+ shell: bash
+ run: |
+ echo "::group::Prepare building selftest"
+ cd .kernel
+ cat tools/testing/selftests/bpf/config \
+ tools/testing/selftests/bpf/config.${{ inputs.arch }} > .config
+ make olddefconfig && make prepare
+ cd -
+ echo "::endgroup::"
+ # 2. if kernel == LATEST, build kernel image from tree
+ - name: Build kernel image
+ if: ${{ inputs.kernel == 'LATEST' }}
+ shell: bash
+ run: |
+ echo "::group::Build Kernel Image"
+ cd .kernel
+ make -j $((4*$(nproc))) all > /dev/null
+ cp vmlinux ${{ github.workspace }}
+ cd -
+ echo "::endgroup::"
+ # else, just download prebuilt kernel image
+ - name: Download prebuilt kernel
+ if: ${{ inputs.kernel != 'LATEST' }}
+ uses: libbpf/ci/download-vmlinux@master
+ with:
+ kernel: ${{ inputs.kernel }}
+ arch: ${{ inputs.arch }}
+ # 3. build selftests
+ - name: Build BPF selftests
+ uses: ./.github/actions/build-selftests
+ with:
+ repo-path: '.kernel'
+ kernel: ${{ inputs.kernel }}
+ # 4. prepare rootfs
+ - name: prepare rootfs
+ uses: libbpf/ci/prepare-rootfs@master
+ with:
+ kernel: ${{ inputs.kernel }}
+ project-name: 'libbpf'
+ arch: ${{ inputs.arch }}
+ image-output: '/tmp/root.img'
+ # 5. run selftest in QEMU
+ - name: Run selftests
+ uses: libbpf/ci/run-qemu@master
+ with:
+ img: '/tmp/root.img'
+ vmlinuz: 'vmlinuz'
+ arch: ${{ inputs.arch }}