-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathinstall-dependencies.sh
More file actions
executable file
·42 lines (32 loc) · 1.53 KB
/
install-dependencies.sh
File metadata and controls
executable file
·42 lines (32 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
set -xeuo pipefail
export DEPS=${1:-"all"} # "build", "run" or "all"
# Most of the BPF CI dependencies are set up by libbpf/ci/setup-build-env action
# This script runs a subset of that, in order to cache the packages at image build time
export LIBBPF_CI_TAG=${LIBBPF_CI_TAG:-"v4"}
export RUNNER_VERSION=${RUNNER_VERSION:-2.331.0}
# These should correspond to https://github.com/kernel-patches/vmtest/blob/master/.github/scripts/matrix.py#L20-L21
# Otherwise there is no point in caching the dependencies in the image
export GCC_VERSION=${GCC_VERSION:-15}
export LLVM_VERSION=${LLVM_VERSION:-21}
scratch=$(mktemp -d)
cd $scratch
# Install pre-requisites for GitHub Actions Runner client app
# https://github.com/actions/runner/blob/main/docs/start/envlinux.md
curl -Lf https://raw.githubusercontent.com/actions/runner/v${RUNNER_VERSION}/src/Misc/layoutbin/installdependencies.sh \
-o install-gha-runner-deps.sh
bash install-gha-runner-deps.sh
# Use libbpf/ci/setup-build-env scripts
git clone --depth 1 --branch $LIBBPF_CI_TAG https://github.com/libbpf/ci.git actions
if [ "$DEPS" = "all" ] || [ "$DEPS" = "build" ]; then
# do not install cross-compilation toolchain by default
export TARGET_ARCH=$(uname -m)
# do not install pahole by default
export PAHOLE_BRANCH="none"
cd "${scratch}/actions/setup-build-env" && ./action.sh
fi
if [ "$DEPS" = "all" ] || [ "$DEPS" = "run" ]; then
cd "${scratch}/actions/run-vmtest" && ./install-dependencies.sh
fi
cd / && rm -rf $scratch
sudo apt-get clean