test: Update 5 files
All checks were successful
Build-Test-Publish / build (linux/amd64) (push) Successful in 25s
Build-Test-Publish / build (linux/arm64) (push) Successful in 27s
Build-Test-Publish / test-install-from-scratch (linux/amd64) (push) Successful in 7s
Build-Test-Publish / test-install-from-scratch (linux/arm64) (push) Successful in 7s

This commit is contained in:
Your Name
2025-06-25 19:41:18 +12:00
parent 428f45bd08
commit dd3e0796cb
5 changed files with 44 additions and 21 deletions

View File

@ -1,5 +1,5 @@
#!/bin/bash
set -euo pipefail
set -uo pipefail # Remove -e to handle errors manually
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
# Arrays to track results
@ -7,6 +7,7 @@ declare -A BUILD_RESULTS
declare -A TEST_RESULTS
declare -A PUBLISH_RESULTS
declare -a PROJECTS
OVERALL_SUCCESS=true
function dothis() {
local thisthing="$1"
@ -41,6 +42,7 @@ function dothis() {
test) TEST_RESULTS["$project"]="✗" ;;
publish) PUBLISH_RESULTS["$project"]="✗" ;;
esac
OVERALL_SUCCESS=false
return 1
fi
fi
@ -101,16 +103,16 @@ function buildtestpublish() {
# Add to projects list
PROJECTS+=("$TOOLNAME")
cd "$dir"
cd "$dir" || echo "Failed to cd to $dir"
subtitle "🔨 BUILDING $TOOLNAME_UPPER 🔨"
dothis build "$dir" "$TOOLNAME" || true
dothis build "$dir" "$TOOLNAME"
subtitle "🔍 TESTING $TOOLNAME_UPPER 🔍"
dothis test "$dir" "$TOOLNAME" || true
dothis test "$dir" "$TOOLNAME"
subtitle "📦 PUBLISHING $TOOLNAME_UPPER 📦"
dothis publish "$dir" "$TOOLNAME" || true
dothis publish "$dir" "$TOOLNAME"
echo "Done"
}
@ -125,30 +127,19 @@ function buildtestpublish_all() {
-print0 | while IFS= read -r -d '' dir; \
do
buildtestpublish "${dir}"
buildtestpublish "${dir}" || true # Continue even if one project fails
done
cd "$PREVIOUS_DIR"
cd "$PREVIOUS_DIR" || echo "Failed to cd to $PREVIOUS_DIR"
}
title "🔨 BUILDING ALL TOOLS 🔨"
getpkg/build.sh
export GETPKG="${SCRIPT_DIR}/getpkg/output/getpkg"
if [ ! -f "$GETPKG" ]; then
echo "Build failed."
exit 1
fi
buildtestpublish_all
function print_summary() {
title "📊 BUILD SUMMARY 📊"
# Calculate column widths
local max_project_width=7 # "PROJECT" header
for project in "${PROJECTS[@]}"; do
if [ ${#project} -gt $max_project_width ]; then
if [ "${#project}" -gt "$max_project_width" ]; then
max_project_width=${#project}
fi
done
@ -157,6 +148,9 @@ function print_summary() {
max_project_width=$((max_project_width + 2))
# Print header
printf "┌"
printf "─%.0s" $(seq 1 $((max_project_width + 2)))
printf "┬─────────┬─────────┬─────────┐\n"
printf "│ %-*s │ %-7s │ %-7s │ %-7s │\n" $max_project_width "PROJECT" "BUILD" "TEST" "PUBLISH"
printf "├"
printf "─%.0s" $(seq 1 $((max_project_width + 2)))
@ -173,9 +167,31 @@ function print_summary() {
"$build_status" "$test_status" "$publish_status"
done
# Print bottom border
printf "└"
printf "─%.0s" $(seq 1 $((max_project_width + 2)))
printf "┴─────────┴─────────┴─────────┘\n"
echo
}
title "🔨 BUILDING ALL TOOLS 🔨"
getpkg/build.sh
export GETPKG="${SCRIPT_DIR}/getpkg/output/getpkg"
if [ ! -f "$GETPKG" ]; then
echo "Build failed."
exit 1
fi
buildtestpublish_all
print_summary
title "🚀 Deployment Complete! 🚀"
if [ "$OVERALL_SUCCESS" = true ]; then
title "🚀 Deployment Complete! 🚀"
exit 0
else
title "❌ Deployment Failed! ❌"
exit 1
fi

View File

@ -34,6 +34,7 @@ print_test_result() {
cleanup() {
echo -e "\n${YELLOW}Cleaning up test artifacts...${NC}"
rm -rf "$TEST_DIR"
echo -e "\nDone.\n"
}
# Set up trap to ensure cleanup runs

Binary file not shown.

View File

@ -378,6 +378,7 @@ int main() {
}
std::cout << "\n=== Test Complete ===" << std::endl;
std::cout << "✓ All dehydrate tests passed successfully!" << std::endl;
return 0;
}

View File

@ -1,5 +1,7 @@
#!/bin/bash
set -euo pipefail
# Simple script to run the dehydrate tests
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@ -7,3 +9,6 @@ cd "$SCRIPT_DIR"
echo "Running dehydrate tests..."
./build_dehydrate_test.sh
echo "Dehydrate tests complete."