Modify dehydrate/test/build_dehydrate_test.sh
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Failing after 1m17s
Build-Test-Publish / build (linux/arm64) (push) Successful in 2m15s
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
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Failing after 1m17s
Build-Test-Publish / build (linux/arm64) (push) Successful in 2m15s
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:
parent
42b51ef0be
commit
a5a36c179b
@ -16,47 +16,48 @@ 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 "Building dehydrate test executable..."
|
||||||
echo "SCRIPT_DIR: $SCRIPT_DIR"
|
|
||||||
echo "Current directory: $(pwd)"
|
|
||||||
echo "Files in current directory:"
|
|
||||||
ls -la
|
|
||||||
|
|
||||||
docker run --rm \
|
# Use docker cp approach since volume mounting may not work in CI
|
||||||
-v "$SCRIPT_DIR":/workdir \
|
CONTAINER_NAME="dehydrate-test-build-$$"
|
||||||
-w /workdir \
|
|
||||||
|
# Start container in detached mode
|
||||||
|
docker run -d --name "$CONTAINER_NAME" \
|
||||||
gitea.jde.nz/public/dropshell-build-base:latest \
|
gitea.jde.nz/public/dropshell-build-base:latest \
|
||||||
bash -c "
|
sleep 60
|
||||||
echo 'Docker working directory:' && pwd
|
|
||||||
echo 'Docker available files:' && ls -la
|
# Copy source file into container
|
||||||
|
docker cp dehydrate_test.cpp "$CONTAINER_NAME":/dehydrate_test.cpp
|
||||||
# Verify we can find the source file
|
|
||||||
if [ ! -f dehydrate_test.cpp ]; then
|
# Compile in container
|
||||||
echo 'ERROR: dehydrate_test.cpp not found in current directory'
|
docker exec "$CONTAINER_NAME" bash -c "
|
||||||
echo 'Available files:' && ls -la
|
echo 'Compiling dehydrate test...'
|
||||||
exit 1
|
if ! g++ -std=c++23 -static /dehydrate_test.cpp -o /dehydrate_test; then
|
||||||
fi
|
echo 'ERROR: Compilation failed'
|
||||||
|
exit 1
|
||||||
# Clean any existing binary and compile
|
fi
|
||||||
rm -f dehydrate_test
|
|
||||||
if ! g++ -std=c++23 -static dehydrate_test.cpp -o dehydrate_test; then
|
# Verify binary was created
|
||||||
echo 'ERROR: Compilation failed'
|
if [ ! -f /dehydrate_test ]; then
|
||||||
exit 1
|
echo 'ERROR: Binary was not created'
|
||||||
fi
|
exit 1
|
||||||
|
fi
|
||||||
# Verify binary was created and is executable
|
|
||||||
if [ ! -f dehydrate_test ]; then
|
# Quick architecture check
|
||||||
echo 'ERROR: Binary was not created'
|
if ! file /dehydrate_test | grep -q 'executable'; then
|
||||||
exit 1
|
echo 'ERROR: Generated file is not an executable'
|
||||||
fi
|
file /dehydrate_test
|
||||||
|
exit 1
|
||||||
# Quick architecture check - just verify the binary format
|
fi
|
||||||
if ! file dehydrate_test | grep -q 'executable'; then
|
|
||||||
echo 'ERROR: Generated file is not an executable'
|
echo 'Compilation successful'
|
||||||
file dehydrate_test
|
"
|
||||||
exit 1
|
|
||||||
fi
|
# Copy binary back to host
|
||||||
"
|
docker cp "$CONTAINER_NAME":/dehydrate_test ./dehydrate_test
|
||||||
|
|
||||||
|
# Clean up container
|
||||||
|
docker rm -f "$CONTAINER_NAME"
|
||||||
|
|
||||||
# Check if compilation succeeded
|
# Check if compilation succeeded
|
||||||
if [ ! -f "./dehydrate_test" ]; then
|
if [ ! -f "./dehydrate_test" ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user