-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci.sh
executable file
·77 lines (66 loc) · 1.41 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
76
77
#!/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/14.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}"