test: Add 1 and update 2 files
This commit is contained in:
@@ -31,7 +31,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: |
|
run: |
|
||||||
cd source && ./test.sh
|
./test.sh
|
||||||
|
|
||||||
- name: Publish as Latest
|
- name: Publish as Latest
|
||||||
run: |
|
run: |
|
||||||
|
@@ -1,12 +1,21 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||||
|
PARENT_DIR="$(dirname "${SCRIPT_DIR}")"
|
||||||
ARCH=$(uname -m)
|
|
||||||
|
|
||||||
PREV_DIR=$(pwd)
|
PREV_DIR=$(pwd)
|
||||||
trap 'cd "$PREV_DIR"' EXIT
|
trap 'cd "$PREV_DIR"' EXIT
|
||||||
|
|
||||||
"$SCRIPT_DIR/output/dropshell.${ARCH}" hash "${SCRIPT_DIR}/test.sh"
|
# The Docker build outputs to the parent directory's output folder
|
||||||
"$SCRIPT_DIR/output/dropshell.${ARCH}" help
|
DROPSHELL="${PARENT_DIR}/output/dropshell"
|
||||||
|
|
||||||
|
# Check if the binary exists
|
||||||
|
if [ ! -f "$DROPSHELL" ]; then
|
||||||
|
echo "Error: dropshell binary not found at $DROPSHELL"
|
||||||
|
echo "Please run build.sh first"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
"$DROPSHELL" hash "${SCRIPT_DIR}/test.sh"
|
||||||
|
"$DROPSHELL" help
|
||||||
|
|
||||||
|
20
test.sh
Executable file
20
test.sh
Executable file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||||
|
|
||||||
|
# Check if the binary exists
|
||||||
|
DROPSHELL="${SCRIPT_DIR}/output/dropshell"
|
||||||
|
if [ ! -f "$DROPSHELL" ]; then
|
||||||
|
echo "Error: dropshell binary not found at $DROPSHELL"
|
||||||
|
echo "Please run ./build.sh first"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Testing dropshell binary..."
|
||||||
|
|
||||||
|
# Run basic tests
|
||||||
|
"$DROPSHELL" hash "$0"
|
||||||
|
"$DROPSHELL" help
|
||||||
|
|
||||||
|
echo "Tests completed successfully!"
|
Reference in New Issue
Block a user