feat: package SSClash server mode for Docker

This commit is contained in:
Rogee
2026-08-21 13:30:53 +08:00
commit 09ddf8f78d
17 changed files with 816 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
#!/bin/sh
set -eu
project_root=$(CDPATH='' cd -- "$(dirname -- "$0")/.." && pwd)
cd "$project_root"
unformatted=$(gofmt -l cmd internal)
if [ -n "$unformatted" ]; then
echo "Go files require formatting:" >&2
echo "$unformatted" >&2
exit 1
fi
go test -race -coverprofile=coverage.out ./internal/...
coverage=$(go tool cover -func=coverage.out | awk '/^total:/ { gsub(/%/, "", $3); print $3 }')
awk -v coverage="$coverage" 'BEGIN { if (coverage + 0 < 65) exit 1 }' || {
echo "unit test coverage ${coverage}% is below required 65%" >&2
exit 1
}
echo "unit test coverage: ${coverage}%"
go test ./...
if command -v docker >/dev/null 2>&1; then
docker compose config --quiet
fi