jeol-t330a/succbone/succd/ci.sh
Serge Bazanski 47302fb350
All checks were successful
/ test (push) Successful in 14s
succd: add ci, tests
2024-09-28 15:55:05 +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."