diff --git a/buildtestpublish_all.sh b/buildtestpublish_all.sh index 04cd0c7..1cebd84 100755 --- a/buildtestpublish_all.sh +++ b/buildtestpublish_all.sh @@ -115,13 +115,35 @@ function buildtestpublish() { cd "$dir" || echo "Failed to cd to $dir" subtitle "🔨 BUILDING $TOOLNAME_UPPER 🔨" - dothis build "$dir" "$TOOLNAME" + if dothis build "$dir" "$TOOLNAME"; then + BUILD_SUCCESS=true + else + BUILD_SUCCESS=false + fi subtitle "🔍 TESTING $TOOLNAME_UPPER 🔍" - dothis test "$dir" "$TOOLNAME" + if [ "$BUILD_SUCCESS" = true ]; then + if dothis test "$dir" "$TOOLNAME"; then + TEST_SUCCESS=true + else + TEST_SUCCESS=false + fi + else + echo "Skipping tests - build failed" + TEST_RESULTS["$TOOLNAME"]="SKIP" + TEST_SUCCESS=false + fi subtitle "📦 PUBLISHING $TOOLNAME_UPPER 📦" - dothis publish "$dir" "$TOOLNAME" + if [ "$BUILD_SUCCESS" = true ] && [ "$TEST_SUCCESS" = true ]; then + dothis publish "$dir" "$TOOLNAME" + elif [ "$BUILD_SUCCESS" = true ] && [ "${TEST_RESULTS[$TOOLNAME]}" = "SKIP" ]; then + # If tests are skipped (no test script), allow publish if build succeeded + dothis publish "$dir" "$TOOLNAME" + else + echo "Skipping publish - build or tests failed" + PUBLISH_RESULTS["$TOOLNAME"]="SKIP" + fi echo "Done" } diff --git a/dehydrate/test/build_dehydrate_test.sh b/dehydrate/test/build_dehydrate_test.sh index 155f9e6..722a7f4 100755 --- a/dehydrate/test/build_dehydrate_test.sh +++ b/dehydrate/test/build_dehydrate_test.sh @@ -16,15 +16,23 @@ rm -f dehydrate_test # Build the test program using Docker # The Docker container supports both amd64 and arm64 architectures +echo "PROJECT_DIR: $PROJECT_DIR" +echo "SCRIPT_DIR: $SCRIPT_DIR" +echo "Current directory: $(pwd)" +echo "Files in current directory:" +ls -la + docker run --rm \ - -v "$PROJECT_DIR":/workdir \ - -w /workdir/test \ + -v "$SCRIPT_DIR":/workdir \ + -w /workdir \ gitea.jde.nz/public/dropshell-build-base:latest \ bash -c " + echo 'Docker working directory:' && pwd + echo 'Docker available files:' && ls -la + # Verify we can find the source file if [ ! -f dehydrate_test.cpp ]; then echo 'ERROR: dehydrate_test.cpp not found in current directory' - echo 'Working directory:' && pwd echo 'Available files:' && ls -la exit 1 fi