test: Update 2 files
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Failing after 1m8s
Build-Test-Publish / build (linux/arm64) (push) Failing after 1m57s
Build-Test-Publish / test-install-from-scratch (linux/amd64) (push) Has been skipped
Build-Test-Publish / test-install-from-scratch (linux/arm64) (push) Has been skipped

This commit is contained in:
Your Name 2025-06-25 22:38:12 +12:00
parent f094d532cf
commit 42b51ef0be
2 changed files with 36 additions and 6 deletions

View File

@ -115,13 +115,35 @@ function buildtestpublish() {
cd "$dir" || echo "Failed to cd to $dir" cd "$dir" || echo "Failed to cd to $dir"
subtitle "🔨 BUILDING $TOOLNAME_UPPER 🔨" 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 🔍" 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 📦" subtitle "📦 PUBLISHING $TOOLNAME_UPPER 📦"
if [ "$BUILD_SUCCESS" = true ] && [ "$TEST_SUCCESS" = true ]; then
dothis publish "$dir" "$TOOLNAME" 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" echo "Done"
} }

View File

@ -16,15 +16,23 @@ rm -f dehydrate_test
# Build the test program using Docker # Build the test program using Docker
# The Docker container supports both amd64 and arm64 architectures # 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 \ docker run --rm \
-v "$PROJECT_DIR":/workdir \ -v "$SCRIPT_DIR":/workdir \
-w /workdir/test \ -w /workdir \
gitea.jde.nz/public/dropshell-build-base:latest \ gitea.jde.nz/public/dropshell-build-base:latest \
bash -c " bash -c "
echo 'Docker working directory:' && pwd
echo 'Docker available files:' && ls -la
# Verify we can find the source file # Verify we can find the source file
if [ ! -f dehydrate_test.cpp ]; then if [ ! -f dehydrate_test.cpp ]; then
echo 'ERROR: dehydrate_test.cpp not found in current directory' echo 'ERROR: dehydrate_test.cpp not found in current directory'
echo 'Working directory:' && pwd
echo 'Available files:' && ls -la echo 'Available files:' && ls -la
exit 1 exit 1
fi fi