Merge pull request #14 from johndoe6345789/copilot/fix-ghcr-build-failure

Fix workflow to fail on Docker image test failures
This commit is contained in:
2025-12-28 18:34:02 +00:00
committed by GitHub
2 changed files with 11 additions and 3 deletions

View File

@@ -68,6 +68,7 @@ jobs:
- name: Test Docker image
run: |
set -e # Exit immediately if a command exits with a non-zero status
echo "Testing SparkOS Docker image..."
# Get the first tag from the metadata output
IMAGE_TAG=$(echo "${{ steps.meta.outputs.tags }}" | head -n1)
@@ -80,10 +81,18 @@ jobs:
fi
# Run the container and check output
docker run --rm "$IMAGE_TAG"
echo "Running container entrypoint test..."
if ! docker run --rm "$IMAGE_TAG"; then
echo "ERROR: Container entrypoint test failed!"
exit 1
fi
# Verify init binary exists and is executable
docker run --rm "$IMAGE_TAG" sh -c "test -x /sparkos/rootfs/sbin/init && echo 'Init binary is executable'"
echo "Verifying init binary is executable..."
if ! docker run --rm "$IMAGE_TAG" sh -c "test -x /sparkos/rootfs/sbin/init && echo 'Init binary is executable'"; then
echo "ERROR: Init binary verification failed!"
exit 1
fi
echo "Docker image test completed successfully!"

View File

@@ -90,7 +90,6 @@ echo ""
echo "To test the init system:"
echo " docker run --rm <image> /sparkos/rootfs/sbin/init --help"
echo ""
exec /bin/sh
EOF
RUN chmod +x /sparkos/test.sh