-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Build selftests/sched_ext | ||
|
||
This action builds selftests/sched_ext given a kernel build | ||
output. Kernel build configuration is supposed to include necessary | ||
flags (i.e. `tools/testing/selftests/sched_ext/config`). | ||
|
||
The action is expected to be executed by a workflow with access to the | ||
Linux kernel repository. | ||
|
||
## Required inputs | ||
|
||
* `kbuild-output` - Path to the kernel build output. | ||
* `repo-root` - Path to the root of the Linux kernel repository. | ||
* `arch` - Kernel build architecture. | ||
* `toolchain` - Toolchain name: `gcc` (default) or `llvm`. | ||
|
||
## Optional inputs | ||
* `llvm-version` - LLVM version, used when `toolchain` is `llvm`. Default: `16`. | ||
* `max-make-jobs` - Maximum number of jobs to use when running make (e.g argument to -j). Default: 4*nproc. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: 'Build selftests/sched_ext' | ||
inputs: | ||
kbuild-output: | ||
description: 'Path to the kernel build output' | ||
required: true | ||
repo-root: | ||
description: "Path to the root of the kernel repository" | ||
required: true | ||
arch: | ||
description: 'arch' | ||
required: true | ||
toolchain: | ||
description: 'gcc or llvm' | ||
default: 'gcc' | ||
required: true | ||
llvm-version: | ||
description: 'llvm version' | ||
required: false | ||
default: '16' | ||
max-make-jobs: | ||
description: 'Maximum number of jobs to use when running make (e.g argument to -j). Default: 4*nproc' | ||
default: '' | ||
|
||
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 }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/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 <<EOF | ||
ARCH=${ARCH} | ||
CROSS_COMPILE=${CROSS_COMPILE} | ||
CLANG=clang-${LLVM_VERSION} | ||
LLC=llc-${LLVM_VERSION} | ||
LLVM_STRIP=llvm-strip-${LLVM_VERSION} | ||
VMLINUX_BTF=${KBUILD_OUTPUT}/vmlinux | ||
EOF | ||
) | ||
SELF_OPTS=$(cat <<EOF | ||
-C ${REPO_ROOT}/tools/testing/selftests/sched_ext | ||
EOF | ||
) | ||
|
||
cd ${REPO_ROOT} | ||
make ${MAKE_OPTS} ${SELF_OPTS} clean | ||
make ${MAKE_OPTS} ${SELF_OPTS} -j $(kernel_build_make_jobs) | ||
|
||
foldable end build_selftests | ||
|