mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2025-01-12 02:19:31 +08:00
add a workaround for the separate VMs running the jobs on CI
This commit is contained in:
parent
4c89a18dda
commit
ef7801922a
4
.github/workflows/build-linux.yml
vendored
4
.github/workflows/build-linux.yml
vendored
@ -73,6 +73,10 @@ jobs:
|
|||||||
path: build-linux-deps
|
path: build-linux-deps
|
||||||
fail-on-cache-miss: true
|
fail-on-cache-miss: true
|
||||||
|
|
||||||
|
- name: Install required packages
|
||||||
|
shell: bash
|
||||||
|
run: sudo chmod 777 build_linux_deps.sh && sudo ./build_linux_deps.sh -packages_only
|
||||||
|
|
||||||
- name: Clone third-party build helpers (build/linux)
|
- name: Clone third-party build helpers (build/linux)
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
@ -27,13 +27,14 @@ third_party_common_dir="$third_party_dir/deps/common/src"
|
|||||||
mycmake="$third_party_deps_dir/cmake-3.27.7-linux-x86_64/bin/cmake"
|
mycmake="$third_party_deps_dir/cmake-3.27.7-linux-x86_64/bin/cmake"
|
||||||
|
|
||||||
[[ -f "$mycmake" ]] || {
|
[[ -f "$mycmake" ]] || {
|
||||||
echo "[X] Couldn't find cmake" >&2
|
echo "[X] Couldn't find cmake" >&2;
|
||||||
exit 1
|
exit 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
# < 0: deduce, > 1: force
|
# < 0: deduce, > 1: force
|
||||||
PARALLEL_THREADS_OVERRIDE=-1
|
PARALLEL_THREADS_OVERRIDE=-1
|
||||||
VERBOSITY=''
|
VERBOSITY=''
|
||||||
|
INSTALL_PACKAGES_ONLY=0
|
||||||
|
|
||||||
for (( i=1; i<=$#; i++ )); do
|
for (( i=1; i<=$#; i++ )); do
|
||||||
var="${!i}"
|
var="${!i}"
|
||||||
@ -47,6 +48,8 @@ for (( i=1; i<=$#; i++ )); do
|
|||||||
#echo "[?] Overriding parralel build jobs count with $PARALLEL_THREADS_OVERRIDE"
|
#echo "[?] Overriding parralel build jobs count with $PARALLEL_THREADS_OVERRIDE"
|
||||||
elif [[ "$var" = "-verbose" ]]; then
|
elif [[ "$var" = "-verbose" ]]; then
|
||||||
VERBOSITY='-v'
|
VERBOSITY='-v'
|
||||||
|
elif [[ "$var" = "-packages_only" ]]; then
|
||||||
|
INSTALL_PACKAGES_ONLY=1
|
||||||
else
|
else
|
||||||
echo "[X] Invalid arg: $var" >&2
|
echo "[X] Invalid arg: $var" >&2
|
||||||
exit 1
|
exit 1
|
||||||
@ -54,6 +57,33 @@ for (( i=1; i<=$#; i++ )); do
|
|||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
last_code=0
|
||||||
|
|
||||||
|
|
||||||
|
############## required packages ##############
|
||||||
|
echo // installing required packages
|
||||||
|
apt update -y
|
||||||
|
last_code=$((last_code + $?))
|
||||||
|
apt install coreutils -y # echo, printf, etc...
|
||||||
|
last_code=$((last_code + $?))
|
||||||
|
apt install build-essential -y
|
||||||
|
last_code=$((last_code + $?))
|
||||||
|
apt install gcc-multilib g++-multilib -y # needed for 32-bit builds
|
||||||
|
last_code=$((last_code + $?))
|
||||||
|
apt install clang -y
|
||||||
|
last_code=$((last_code + $?))
|
||||||
|
apt install binutils -y # (optional) contains the tool 'readelf' mainly, and other usefull binary stuff
|
||||||
|
last_code=$((last_code + $?))
|
||||||
|
apt install tar -y # we need to extract packages
|
||||||
|
last_code=$((last_code + $?))
|
||||||
|
#apt install cmake git wget unzip -y
|
||||||
|
|
||||||
|
# exit early if we should install packages only, used by CI mainly
|
||||||
|
[[ "$INSTALL_PACKAGES_ONLY" -ne 0 ]] && exit $last_code
|
||||||
|
|
||||||
|
echo ; echo
|
||||||
|
|
||||||
|
|
||||||
# use 70%
|
# use 70%
|
||||||
build_threads="$(( $(getconf _NPROCESSORS_ONLN 2>/dev/null || echo 0) * 70 / 100 ))"
|
build_threads="$(( $(getconf _NPROCESSORS_ONLN 2>/dev/null || echo 0) * 70 / 100 ))"
|
||||||
[[ $PARALLEL_THREADS_OVERRIDE -gt 0 ]] && build_threads="$PARALLEL_THREADS_OVERRIDE"
|
[[ $PARALLEL_THREADS_OVERRIDE -gt 0 ]] && build_threads="$PARALLEL_THREADS_OVERRIDE"
|
||||||
@ -73,22 +103,6 @@ mkdir -p "$deps_dir" || {
|
|||||||
|
|
||||||
echo; echo
|
echo; echo
|
||||||
|
|
||||||
last_code=0
|
|
||||||
|
|
||||||
|
|
||||||
############## required packages ##############
|
|
||||||
echo // installing required packages
|
|
||||||
apt update -y
|
|
||||||
apt install coreutils -y # echo, printf, etc...
|
|
||||||
apt install build-essential -y
|
|
||||||
apt install gcc-multilib g++-multilib -y # needed for 32-bit builds
|
|
||||||
apt install clang -y
|
|
||||||
apt install binutils -y # (optional) contains the tool 'readelf' mainly, and other usefull binary stuff
|
|
||||||
apt install tar -y # we need to extract packages
|
|
||||||
#apt install cmake git wget unzip -y
|
|
||||||
|
|
||||||
echo ; echo
|
|
||||||
|
|
||||||
|
|
||||||
############## copy CMAKE toolchains to the home directory
|
############## copy CMAKE toolchains to the home directory
|
||||||
echo // creating CMAKE toolchains in "$deps_dir"
|
echo // creating CMAKE toolchains in "$deps_dir"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user