jeol-t330a/succbone/succd/ci.sh
Serge Bazanski a7690a16cb
Some checks failed
/ test (push) Failing after 11s
succd: add ci, tests
2024-09-28 15:45:18 +02:00

31 lines
567 B
Bash
Executable file

#!/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."