mirror of
https://github.com/netdata/libbpf.git
synced 2026-04-05 16:19:06 +08:00
create ondemand vmtest workflow
This commit is contained in:
committed by
Andrii Nakryiko
parent
dd34504b43
commit
d3e4039a0a
@@ -4,13 +4,13 @@ set -eu
|
||||
|
||||
source $(cd $(dirname $0) && pwd)/helpers.sh
|
||||
|
||||
travis_fold start build_pahole "Building pahole"
|
||||
|
||||
CWD=$(pwd)
|
||||
REPO_PATH=$1
|
||||
PAHOLE_ORIGIN=https://git.kernel.org/pub/scm/devel/pahole/pahole.git
|
||||
PAHOLE_ORIGIN=${PAHOLE_ORIGIN:-https://git.kernel.org/pub/scm/devel/pahole/pahole.git}
|
||||
PAHOLE_BRANCH=${PAHOLE_BRANCH:-master}
|
||||
|
||||
travis_fold start build_pahole "Building pahole ${PAHOLE_ORIGIN} ${PAHOLE_BRANCH}"
|
||||
|
||||
mkdir -p ${REPO_PATH}
|
||||
cd ${REPO_PATH}
|
||||
git init
|
||||
|
||||
@@ -8,12 +8,22 @@ CWD=$(pwd)
|
||||
LIBBPF_PATH=$(pwd)
|
||||
REPO_PATH=$1
|
||||
|
||||
BPF_NEXT_ORIGIN=https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git
|
||||
LINUX_SHA=$(cat ${LIBBPF_PATH}/CHECKPOINT-COMMIT)
|
||||
SNAPSHOT_URL=https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/snapshot/bpf-next-${LINUX_SHA}.tar.gz
|
||||
KERNEL_ORIGIN=${KERNEL_ORIGIN:-https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git}
|
||||
KERNEL_BRANCH=${KERNEL_BRANCH:-CHECKPOINT}
|
||||
if [[ "${KERNEL_BRANCH}" = 'CHECKPOINT' ]]; then
|
||||
echo "using CHECKPOINT sha1"
|
||||
LINUX_SHA=$(cat ${LIBBPF_PATH}/CHECKPOINT-COMMIT)
|
||||
else
|
||||
echo "using ${KERNEL_BRANCH} sha1"
|
||||
LINUX_SHA=$(git ls-remote ${KERNEL_ORIGIN} ${KERNEL_BRANCH} | awk '{print $1}')
|
||||
fi
|
||||
SNAPSHOT_URL=${KERNEL_ORIGIN}/snapshot/bpf-next-${LINUX_SHA}.tar.gz
|
||||
|
||||
echo REPO_PATH = ${REPO_PATH}
|
||||
|
||||
echo KERNEL_ORIGIN = ${KERNEL_ORIGIN}
|
||||
echo LINUX_SHA = ${LINUX_SHA}
|
||||
echo SNAPSHOT_URL = ${SNAPSHOT_URL}
|
||||
|
||||
if [ ! -d "${REPO_PATH}" ]; then
|
||||
echo
|
||||
@@ -29,7 +39,7 @@ if [ ! -d "${REPO_PATH}" ]; then
|
||||
mkdir -p $(basename ${REPO_PATH})
|
||||
cd $(basename ${REPO_PATH})
|
||||
git init
|
||||
git remote add bpf-next ${BPF_NEXT_ORIGIN}
|
||||
git remote add bpf-next ${KERNEL_ORIGIN}
|
||||
# try shallow clone first
|
||||
git fetch --depth 32 bpf-next
|
||||
# check if desired SHA exists
|
||||
|
||||
@@ -24,7 +24,7 @@ sudo aptitude install -y clang-13 lld-13 llvm-13
|
||||
travis_fold end install_clang
|
||||
|
||||
# Build selftests (and latest kernel, if necessary)
|
||||
KERNEL="${KERNEL}" ${VMTEST_ROOT}/prepare_selftests.sh travis-ci/vmtest/bpf-next
|
||||
${VMTEST_ROOT}/prepare_selftests.sh travis-ci/vmtest/bpf-next
|
||||
|
||||
# Escape whitespace characters.
|
||||
setup_cmd=$(sed 's/\([[:space:]]\)/\\\1/g' <<< "${VMTEST_SETUPCMD}")
|
||||
|
||||
Reference in New Issue
Block a user