0969529fc5
Docker Build and Push / lint (push) Failing after 4s
Docker Build and Push / build (push) Has been skipped
Docker Build and Push / test (push) Has been skipped
Docker Build and Push / push (push) Has been skipped
Docker Build and Push / lint (pull_request) Failing after 7s
Docker Build and Push / build (pull_request) Has been skipped
Docker Build and Push / test (pull_request) Has been skipped
Docker Build and Push / push (pull_request) Has been skipped
31 lines
614 B
Bash
31 lines
614 B
Bash
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
IMAGE="$1"
|
|
FAILED=0
|
|
PASSED=0
|
|
|
|
assert_contains() {
|
|
local desc="$1" pattern="$2" file="$3"
|
|
if grep -qEi "$pattern" "$file"; then
|
|
echo "PASS: $desc"
|
|
PASSED=$((PASSED + 1))
|
|
else
|
|
echo "FAIL: $desc"
|
|
FAILED=$((FAILED + 1))
|
|
fi
|
|
}
|
|
|
|
TMPDIR="$(mktemp -d)"
|
|
trap 'rm -rf "$TMPDIR"' EXIT
|
|
|
|
# Test 1: Container runs without error
|
|
docker run --rm "$IMAGE" duplicacy -version > "$TMPDIR/output" 2>&1 || true
|
|
assert_contains "Command produces output" "duplicacy" "$TMPDIR/output"
|
|
|
|
echo ""
|
|
echo "$PASSED/$((PASSED + FAILED)) tests passed"
|
|
if [ "$FAILED" -gt 0 ]; then
|
|
exit 1
|
|
fi
|