ci: integrate coverage into linux arch job, remove duplicate
All checks were successful
CI Code / Check spelling (pull_request) Successful in 16s
CI Code / Check coding style (pull_request) Successful in 30s
CI Code / Code Coverage (pull_request) Successful in 4m21s
CI Code / Linux (ubuntu) (pull_request) Successful in 6m37s
CI Code / Linux (debian) (pull_request) Successful in 6m39s
CI Code / Linux (arch) (pull_request) Successful in 6m49s
All checks were successful
CI Code / Check spelling (pull_request) Successful in 16s
CI Code / Check coding style (pull_request) Successful in 30s
CI Code / Code Coverage (pull_request) Successful in 4m21s
CI Code / Linux (ubuntu) (pull_request) Successful in 6m37s
CI Code / Linux (debian) (pull_request) Successful in 6m39s
CI Code / Linux (arch) (pull_request) Successful in 6m49s
- Linux arch job now uploads coverage.info as artifact - ci-build.sh saves coverage.info before cleanup - Removed separate coverage job (was duplicating arch build) - Saves ~25% CI time by eliminating redundant build
This commit is contained in:
88
ci-build.sh
88
ci-build.sh
@@ -110,6 +110,17 @@ num_cores()
|
||||
# Run test failure detection verification first
|
||||
verify_test_failure_detection
|
||||
|
||||
# Parse arguments
|
||||
COVERAGE_ONLY=no
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--coverage-only)
|
||||
COVERAGE_ONLY=yes
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
./bootstrap.sh
|
||||
|
||||
tests=()
|
||||
@@ -286,6 +297,13 @@ build_and_test() {
|
||||
fi
|
||||
|
||||
./profanity -v
|
||||
|
||||
# Save coverage.info before cleanup (for CI artifact)
|
||||
if [ "$run_coverage" = "yes" ] && [ -f coverage.info ]; then
|
||||
cp coverage.info ../coverage.info
|
||||
echo "Coverage report saved to coverage.info"
|
||||
fi
|
||||
|
||||
$MAKE clean
|
||||
|
||||
cd ..
|
||||
@@ -300,40 +318,52 @@ build_and_test() {
|
||||
} > "$log_file" 2>&1
|
||||
}
|
||||
|
||||
# Run all 4 configurations in parallel
|
||||
# Run configurations
|
||||
# Coverage enabled only for build 1 (Full) - it has most code paths
|
||||
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
|
||||
# All builds run Valgrind
|
||||
if [ "$ARCH" = "linux" ]; then
|
||||
run_valgrind="yes"
|
||||
if [ $idx -eq 1 ]; then
|
||||
extra_flags="--enable-valgrind --enable-coverage"
|
||||
run_coverage="yes"
|
||||
|
||||
if [ "$COVERAGE_ONLY" = "yes" ]; then
|
||||
echo "Running coverage-only mode (build 1 only)..."
|
||||
echo
|
||||
run_valgrind="no"
|
||||
run_coverage="yes"
|
||||
extra_flags="--enable-coverage"
|
||||
build_and_test "${tests[0]}" "$* $extra_flags" "1" "$run_valgrind" "$run_coverage" &
|
||||
pids=("$!")
|
||||
echo " → Build 1: ${tests[0]} [+Coverage]"
|
||||
else
|
||||
echo "Starting 4 parallel build configurations..."
|
||||
echo
|
||||
pids=()
|
||||
for idx in 1 2 3 4; do
|
||||
if [ $idx -le ${#tests[@]} ]; then
|
||||
# All builds run Valgrind
|
||||
if [ "$ARCH" = "linux" ]; then
|
||||
run_valgrind="yes"
|
||||
if [ $idx -eq 1 ]; then
|
||||
extra_flags="--enable-valgrind --enable-coverage"
|
||||
run_coverage="yes"
|
||||
else
|
||||
extra_flags="--enable-valgrind"
|
||||
run_coverage="no"
|
||||
fi
|
||||
else
|
||||
extra_flags="--enable-valgrind"
|
||||
extra_flags=""
|
||||
run_valgrind="no"
|
||||
run_coverage="no"
|
||||
fi
|
||||
else
|
||||
extra_flags=""
|
||||
run_valgrind="no"
|
||||
run_coverage="no"
|
||||
build_and_test "${tests[$((idx-1))]}" "$* $extra_flags" "$idx" "$run_valgrind" "$run_coverage" &
|
||||
pids+=("$!")
|
||||
flags_desc=""
|
||||
[ "$run_valgrind" = "yes" ] && flags_desc="Valgrind"
|
||||
[ "$run_coverage" = "yes" ] && flags_desc="${flags_desc:+$flags_desc+}Coverage"
|
||||
[ -n "$flags_desc" ] && flags_desc=" [+$flags_desc]"
|
||||
echo " → Build $idx: ${tests[$((idx-1))]}$flags_desc"
|
||||
fi
|
||||
build_and_test "${tests[$((idx-1))]}" "$* $extra_flags" "$idx" "$run_valgrind" "$run_coverage" &
|
||||
pids+=("$!")
|
||||
flags_desc=""
|
||||
[ "$run_valgrind" = "yes" ] && flags_desc="Valgrind"
|
||||
[ "$run_coverage" = "yes" ] && flags_desc="${flags_desc:+$flags_desc+}Coverage"
|
||||
[ -n "$flags_desc" ] && flags_desc=" [+$flags_desc]"
|
||||
echo " → Build $idx: ${tests[$((idx-1))]}$flags_desc"
|
||||
fi
|
||||
done
|
||||
done
|
||||
fi
|
||||
echo
|
||||
|
||||
# Wait for all builds and check exit codes
|
||||
@@ -389,5 +419,9 @@ if [ ${#failed_builds[@]} -gt 0 ]; then
|
||||
echo "RESULT: FAILED (builds ${failed_builds[*]})"
|
||||
exit 1
|
||||
else
|
||||
echo "RESULT: ALL 4 BUILDS PASSED ✓"
|
||||
if [ "$COVERAGE_ONLY" = "yes" ]; then
|
||||
echo "RESULT: COVERAGE BUILD PASSED ✓"
|
||||
else
|
||||
echo "RESULT: ALL 4 BUILDS PASSED ✓"
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user