diff --git a/build-linux/build.sh b/build-linux/build.sh index b4dbcb5..326a6bc 100755 --- a/build-linux/build.sh +++ b/build-linux/build.sh @@ -30,6 +30,7 @@ cat_kernel_config() { cat ${GITHUB_WORKSPACE}/tools/testing/selftests/bpf/config \ ${GITHUB_WORKSPACE}/tools/testing/selftests/bpf/config.vm \ ${GITHUB_WORKSPACE}/tools/testing/selftests/bpf/config.${TARGET_ARCH} \ + ${GITHUB_WORKSPACE}/tools/testing/selftests/sched_ext/config \ ${GITHUB_WORKSPACE}/ci/vmtest/configs/config \ ${GITHUB_WORKSPACE}/ci/vmtest/configs/config.${TARGET_ARCH} 2> /dev/null > "${1}" } diff --git a/build-scx-selftests/action.yml b/build-scx-selftests/action.yml new file mode 100644 index 0000000..fd00dd9 --- /dev/null +++ b/build-scx-selftests/action.yml @@ -0,0 +1,34 @@ +name: 'build selftests' +description: 'Build selftests/sched_ext' +inputs: + kbuild-output: + description: 'relative or absolute path to use for storing build artifacts' + required: true + arch: + description: 'arch' + required: true + toolchain: + description: 'what toolchain to use' + default: 'gcc' + required: true + repo-root: + description: "Path to the root of the kernel repository. Default: github.workspace" + max-make-jobs: + description: 'Maximum number of jobs to use when running make (e.g argument to -j). Default: 4*nproc' + default: '' + llvm-version: + description: 'llvm version' + required: false + default: '16' + +runs: + using: "composite" + steps: + - name: build selftests/sched_ext + env: + KBUILD_OUTPUT: ${{ inputs.kbuild-output }} + MAX_MAKE_JOBS: ${{ inputs.max-make-jobs }} + REPO_ROOT: ${{ inputs.repo-root || github.workspace }} + shell: bash + run: + ${GITHUB_ACTION_PATH}/build.sh "${{ inputs.arch }}" "${{ inputs.toolchain }}" "${{ inputs.llvm-version }}" diff --git a/build-scx-selftests/build.sh b/build-scx-selftests/build.sh new file mode 100755 index 0000000..129bfd5 --- /dev/null +++ b/build-scx-selftests/build.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +set -euo pipefail + +source "${GITHUB_ACTION_PATH}/../helpers.sh" + +TARGET_ARCH=$1 +TOOLCHAIN=$2 +LLVM_VERSION=$3 + +ARCH="$(platform_to_kernel_arch ${TARGET_ARCH})" +CROSS_COMPILE="" + +if [[ "${TARGET_ARCH}" != "$(uname -m)" ]] +then + CROSS_COMPILE="${TARGET_ARCH}-linux-gnu-" +fi + +if [[ $TOOLCHAIN = "llvm" ]]; then + export LLVM="-$LLVM_VERSION" + TOOLCHAIN="llvm-$LLVM_VERSION" +fi + +foldable start build_selftests "Building selftests/sched_ext with $TOOLCHAIN" + +MAKE_OPTS=$(cat <