-
Notifications
You must be signed in to change notification settings - Fork 17
/
.travis.sh
executable file
·40 lines (33 loc) · 781 Bytes
/
.travis.sh
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
37
38
39
40
#!/bin/sh
set -e
exit_code=0
go get -u golang.org/x/lint/golint
[ "0" = "$?" ] || exit 1
go get -u github.com/golang/dep/cmd/dep
[ "0" = "$?" ] || exit 2
dep ensure
[ "0" = "$?" ] || exit 3
for dir in $(go list ./... | grep -v vendor); do
echo "golint $dir"
result=$(golint $dir)
if [ "" != "$result" ]; then
echo $result
exit_code=5
fi
if [ "0" != "$exit_code" ]; then
exit $exit_code
fi
done
rm -f coverage.txt
for dir in $(go list ./... | grep -v vendor); do
go test -timeout 60s -coverprofile=profile.out $dir
exit_code=$?
if [ "0" != "$exit_code" ]; then
exit $exit_code
fi
if [ -f profile.out ]; then
cat profile.out >> coverage.txt
rm profile.out
fi
done
exit $exit_code