forked from coreos/ignition
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest
More file actions
executable file
·36 lines (26 loc) · 710 Bytes
/
Copy pathtest
File metadata and controls
executable file
·36 lines (26 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
set -eu
source ./build
SRC=$(find . -name '*.go' \
-not -path "./internal/vendor/*" \
-not -path "./config/vendor/*" \
-not -path "./config/v1/vendor/*")
PKG=$(cd gopath/src/${REPO_PATH}; go list ./... | \
grep --invert-match vendor)
# https://github.com/golang/go/issues/15067
PKG_VET=$(cd gopath/src/${REPO_PATH}; go list ./... | \
grep --invert-match vendor | \
grep --invert-match internal/log)
echo "Checking gofix..."
go tool fix -diff $SRC
echo "Checking gofmt..."
res=$(gofmt -d -e -s $SRC)
echo "${res}"
if [ -n "${res}" ]; then
exit 1
fi
echo "Checking govet..."
go vet $PKG_VET
echo "Running tests..."
go test -timeout 60s -cover $@ ${PKG} --race
echo "Success"