forked from ClangBuiltLinux/tc-build
-
Notifications
You must be signed in to change notification settings - Fork 31
/
ci.sh
executable file
·75 lines (66 loc) · 1.43 KB
/
ci.sh
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/env bash
BASE=$(dirname "$(readlink -f "${0}")")
set -eu
function parse_parameters() {
while ((${#})); do
case ${1} in
all | binutils | deps | kernel | llvm) ACTION=${1} ;;
*) exit 33 ;;
esac
shift
done
}
function do_all() {
do_deps
do_llvm
do_binutils
do_kernel
}
function do_binutils() {
"${BASE}"/build-binutils.py -t x86_64
}
function do_deps() {
# We only run this when running on GitHub Actions
[[ -z ${GITHUB_ACTIONS:-} ]] && return 0
sudo apt-get install -y --no-install-recommends \
bc \
bison \
ca-certificates \
clang \
cmake \
curl \
file \
flex \
gcc \
g++ \
git \
libelf-dev \
libssl-dev \
lld \
make \
ninja-build \
python3 \
texinfo \
xz-utils \
zlib1g-dev
}
function do_kernel() {
cd "${BASE}"/kernel
./build.sh -t X86
}
function do_llvm() {
EXTRA_ARGS=()
[[ -n ${GITHUB_ACTIONS:-} ]] && EXTRA_ARGS+=(--no-ccache)
"${BASE}"/build-llvm.py \
--assertions \
--branch "release/12.x" \
--build-stage1-only \
--check-targets clang lld llvm \
--install-stage1-only \
--projects "clang;lld" \
--shallow-clone \
--targets X86 \
"${EXTRA_ARGS[@]}"
}
parse_parameters "${@}"
do_"${ACTION:=all}"