chore(ci): limit number of parallel builds to prevent runner resource starvation (#6683)

This commit is contained in:
Peter Feerick
2025-10-20 13:04:05 +10:00
committed by GitHub
parent f194260070
commit 12b9d8dbef
9 changed files with 76 additions and 48 deletions
+9 -10
View File
@@ -14,6 +14,9 @@ if [[ -z ${OUTDIR} ]]; then
OUTDIR="$(pwd)/output"
fi
# Determine parallel jobs
determine_max_jobs
# Create a master log file for the entire build process
MASTER_LOG="build-summary.log"
@@ -48,10 +51,6 @@ if [[ -z ${EDGETX_VERSION_SUFFIX} ]]; then
fi
fi
if [ "$(uname)" = "Linux" ] && [ -n "$GITHUB_ACTIONS" ]; then
MAX_JOBS=3
fi
rm -rf build && mkdir build && cd build
# Function to output error logs (works in both GitHub Actions and terminal)
@@ -97,7 +96,7 @@ run_pipeline() {
local log_file="${2:-/dev/null}"
local context="$3"
local show_details="${4:-false}"
local cmake_opts="--parallel ${MAX_JOBS} ${QUIET_FLAGS}"
local cmake_opts="${QUIET_FLAGS}"
case "$pipeline_type" in
"plugin")
@@ -106,25 +105,25 @@ run_pipeline() {
output_error_log "$log_file" "$context (Configuration)"
return 1
fi
if ! execute_with_output "🔧 Native config" "cmake --build . --target native-configure ${cmake_opts}" "$log_file" "$show_details"; then
if ! execute_with_output "🔧 Native config" "cmake_build_parallel . --target native-configure ${cmake_opts}" "$log_file" "$show_details"; then
output_error_log "$log_file" "$context (Native Configure)"
return 1
fi
if ! execute_with_output "📦 Building lib" "cmake --build native --target libsimulator ${cmake_opts}" "$log_file" "$show_details"; then
if ! execute_with_output "📦 Building lib" "cmake_build_parallel native --target libsimulator ${cmake_opts}" "$log_file" "$show_details"; then
output_error_log "$log_file" "$context (Library Build)"
return 1
fi
;;
"final")
if ! execute_with_output "🔧 Final config" "cmake --build . --target native-configure ${cmake_opts}" "$log_file" "$show_details"; then
if ! execute_with_output "🔧 Final config" "cmake_build_parallel . --target native-configure ${cmake_opts}" "$log_file" "$show_details"; then
output_error_log "$log_file" "Final Configuration"
return 1
fi
if ! execute_with_output "📦 Building companion" "cmake --build native --target companion ${cmake_opts}" "$log_file" "$show_details"; then
if ! execute_with_output "📦 Building companion" "cmake_build_parallel native --target companion ${cmake_opts}" "$log_file" "$show_details"; then
output_error_log "$log_file" "$context (Companion Build)"
return 1
fi
if ! execute_with_output "📦 Packaging" "cmake --build native --target ${PACKAGE_TARGET}" "$log_file" "true"; then
if ! execute_with_output "📦 Packaging" "cmake_build_parallel native --target ${PACKAGE_TARGET}" "$log_file" "true"; then
output_error_log "$log_file" "Final Packaging"
return 1
fi