Compare commits

..

1 Commits

Author SHA1 Message Date
ce4cb13470 ci: improve CI stability with parallel builds, Valgrind, and coverage
All checks were successful
CI Code / Check spelling (pull_request) Successful in 22s
CI Code / Check coding style (pull_request) Successful in 33s
CI Code / Linux (debian) (pull_request) Successful in 6m48s
CI Code / Linux (ubuntu) (pull_request) Successful in 9m24s
CI Code / Linux (arch) (pull_request) Successful in 12m6s
CI Code / Code Coverage (pull_request) Successful in 15m50s
2026-01-28 20:21:00 +03:00

View File

@@ -299,7 +299,11 @@ build_and_test() {
# Run all 4 configurations in parallel
# Coverage enabled only for build 1 (Full) - it has most code paths
echo "Starting parallel builds..."
echo
echo "=== Start build ==="
echo
echo "Starting 4 parallel build configurations..."
echo
pids=()
for idx in 1 2 3 4; do
if [ $idx -le ${#tests[@]} ]; then
@@ -324,16 +328,18 @@ for idx in 1 2 3 4; do
[ "$run_valgrind" = "yes" ] && flags_desc="Valgrind"
[ "$run_coverage" = "yes" ] && flags_desc="${flags_desc:+$flags_desc+}Coverage"
[ -n "$flags_desc" ] && flags_desc=" [+$flags_desc]"
echo "Started build $idx (PID: $!)$flags_desc"
echo " → Build $idx: ${tests[$((idx-1))]}$flags_desc"
fi
done
echo
# Wait for all builds and check exit codes
echo "Waiting for builds to complete..."
echo
failed_builds=()
for i in "${!pids[@]}"; do
idx=$((i + 1))
if wait "${pids[$i]}"; then
stats=""
if [ -f "build-$idx.log" ]; then
stats_line=$(grep "^STATS:" "build-$idx.log" | tail -1)
unit_p=$(echo "$stats_line" | grep -oE "unit_passed=[0-9]+" | cut -d= -f2)
@@ -345,37 +351,40 @@ for i in "${!pids[@]}"; do
cov_branches=$(echo "$stats_line" | grep -oE "cov_branches=[0-9.]+%|cov_branches=n/a" | cut -d= -f2)
time=$(echo "$stats_line" | grep -oE "time=[0-9]+m[0-9]+s" | cut -d= -f2)
# Format: passed/failed for each test type
unit_str="${unit_p:-0}/${unit_f:-0}"
func_str="${func_p:-0}/${func_f:-0}"
unit_p=${unit_p:-0}
unit_f=${unit_f:-0}
func_p=${func_p:-0}
func_f=${func_f:-0}
echo "✓ BUILD $idx PASSED"
echo " Unit tests: $unit_p passed, $unit_f failed"
echo " Functional tests: $func_p passed, $func_f failed"
if [ "$cov_lines" != "n/a" ] && [ -n "$cov_lines" ]; then
stats=" (unit: $unit_str, func: $func_str, cov: L:$cov_lines F:$cov_funcs B:$cov_branches, ${time:-?})"
else
stats=" (unit: $unit_str, func: $func_str, ${time:-?})"
echo " Coverage: Lines: $cov_lines | Functions: $cov_funcs | Branches: $cov_branches"
fi
echo " Duration: ${time:-?}"
else
echo "✓ Build $idx passed (no stats available)"
fi
echo "✓ Build $idx passed$stats"
else
echo "✗ Build $idx failed"
echo "✗ BUILD $idx FAILED"
failed_builds+=("$idx")
fi
echo
done
echo
# Show failed builds full logs
for idx in "${failed_builds[@]}"; do
if [ -f "build-$idx.log" ]; then
echo "=== Build $idx (FAILED) - full log ==="
echo "=== BUILD $idx FAILURE LOG ==="
cat "build-$idx.log"
echo
fi
done
if [ ${#failed_builds[@]} -gt 0 ]; then
echo "FAILED: builds ${failed_builds[*]}"
echo "RESULT: FAILED (builds ${failed_builds[*]})"
exit 1
else
echo "All builds passed!"
echo "RESULT: ALL 4 BUILDS PASSED ✓"
fi