succd: add ci, tests
All checks were successful
/ test (push) Successful in 4s

This commit is contained in:
Serge Bazanski 2024-09-28 15:28:49 +02:00
parent 96e07ece2d
commit 2454a44350
3 changed files with 109 additions and 0 deletions

30
succbone/succd/ci.sh Executable file
View file

@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -e
set -o pipefail
if [ ! -f go.mod ]; then
echo "Script needs to be run with in succd directory."
exit 1
fi
echo "Running gofmt..."
GOFMT_OUT="$(gofmt -d $(find . -name '*.go'))"
if [ -n "$GOFMT_OUT" ]; then
echo "gofmt generated differences, please run 'go fmt ./' and try again."
echo "$GOFMT_OUT"
exit 1
fi
echo "Running govet..."
GOVET_OUT="$(go vet ./)"
if [ -n "$GOVET_OUT" ]; then
echo "go vet found the following errors:"
echo "$GOVET_OUT"
exit 1
fi
echo "Running tests..."
go test ./
echo "OK."