diff --git a/.github/scripts/tar-artifact.sh b/.github/scripts/tar-artifact.sh index 133151c..8f9b813 100644 --- a/.github/scripts/tar-artifact.sh +++ b/.github/scripts/tar-artifact.sh @@ -13,7 +13,6 @@ fi arch="${1}" toolchain="${2}" -archive_make_helpers="${3:-0}" # Convert a platform (as returned by uname -m) to the kernel # arch (as expected by ARCH= env). @@ -74,7 +73,7 @@ for file in "${kbuild_output_file_list[@]}"; do done additional_file_list=() -if [ $archive_make_helpers -ne 0 ]; then +if [[ -n "${ARCHIVE_MAKE_HELPERS}" ]]; then # Package up a bunch of additional infrastructure to support running # 'make kernelrelease' and bpf tool checks later on. mapfile -t additional_file_list < <(find . -iname Makefile) @@ -86,6 +85,11 @@ if [ $archive_make_helpers -ne 0 ]; then ) fi +mkdir -p selftests +cp -r tools/testing/selftests/bpf selftests +if [[ -n "${BUILD_SCHED_EXT_SELFTESTS}" ]]; then + cp -r tools/testing/selftests/sched_ext selftests +fi tar -cf - \ kbuild-output \ @@ -94,7 +98,7 @@ tar -cf - \ --exclude '*.d' \ --exclude '*.h' \ --exclude '*.output' \ - selftests/bpf/ \ + selftests/ \ | zstd -T0 -19 -o "vmlinux-${arch}-${toolchain}.tar.zst" # Cleanup and restore the original KBUILD_OUTPUT diff --git a/.github/workflows/kernel-build.yml b/.github/workflows/kernel-build.yml index aafb908..7925531 100644 --- a/.github/workflows/kernel-build.yml +++ b/.github/workflows/kernel-build.yml @@ -45,7 +45,7 @@ jobs: runs-on: ${{ fromJSON(inputs.runs_on) }} timeout-minutes: 100 env: - ARCHIVE_MAKE_HELPERS: ${{ github.repository != 'kernel-patches/bpf' && '1' || '0' }} + ARCHIVE_MAKE_HELPERS: ${{ github.repository != 'kernel-patches/bpf' && 'true' || '' }} KERNEL: ${{ inputs.kernel }} REPO_ROOT: ${{ github.workspace }} REPO_PATH: "" @@ -55,6 +55,7 @@ jobs: || github.base_ref || 'bpf-next' }} + BUILD_SCHED_EXT_SELFTESTS: ${{ inputs.arch == 'x86_64' || inputs.arch == 'aarch64' && 'true' || '' }} steps: - uses: actions/checkout@v4 # We fetch an actual bit of history here to facilitate incremental @@ -83,22 +84,30 @@ jobs: - uses: libbpf/ci/patch-kernel@v1 with: patches-root: '${{ github.workspace }}/ci/diffs' - repo-root: '${{ github.workspace }}' + repo-root: ${{ env.REPO_ROOT }} - name: Setup build environment uses: libbpf/ci/setup-build-env@v1 with: arch: ${{ inputs.arch }} llvm-version: ${{ inputs.llvm-version }} pahole: c2f89dab3f2b0ebb53bab3ed8be32f41cb743c37 + - 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@v1 + uses: theihor/libbpf-ci/build-linux@build-scx with: arch: ${{ inputs.arch }} toolchain: ${{ inputs.toolchain }} kbuild-output: ${{ env.KBUILD_OUTPUT }} max-make-jobs: 32 llvm-version: ${{ inputs.llvm-version }} - - name: Build selftests + - name: Build selftests/bpf uses: libbpf/ci/build-selftests@v1 with: arch: ${{ inputs.arch }} @@ -111,6 +120,16 @@ jobs: # RELEASE=0 adds -O0 make flag # RELEASE=1 adds -O2 make flag RELEASE: ${{ inputs.release && '1' || '' }} + - if: ${{ env.BUILD_SCHED_EXT_SELFTESTS }} + name: Build selftests/sched_ext + uses: theihor/libbpf-ci/build-scx-selftests@build-scx + with: + kbuild-output: ${{ env.KBUILD_OUTPUT }} + repo-root: ${{ env.REPO_ROOT }} + arch: ${{ inputs.arch }} + 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@v1 @@ -123,7 +142,7 @@ jobs: - name: Tar artifacts working-directory: ${{ env.REPO_ROOT }} run: | - bash .github/scripts/tar-artifact.sh ${{ inputs.arch }} ${{ inputs.toolchain_full }} ${{ env.ARCHIVE_MAKE_HELPERS }} + bash .github/scripts/tar-artifact.sh ${{ inputs.arch }} ${{ inputs.toolchain_full }} - if: ${{ github.event_name != 'push' }} name: Remove KBUILD_OUTPUT content shell: bash