ci: add smoke test for ansible-lint
Docker Build and Push / lint (push) Failing after 7s
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 6s
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

This commit is contained in:
2026-06-08 18:56:24 -04:00
parent 8c22291cb0
commit 4c6aa39a5f
+30
View File
@@ -0,0 +1,30 @@
#!/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" --help > "$TMPDIR/output" 2>&1 || true
assert_contains "Command produces output" "ansible-lint" "$TMPDIR/output"
echo ""
echo "$PASSED/$((PASSED + FAILED)) tests passed"
if [ "$FAILED" -gt 0 ]; then
exit 1
fi