Fix testing in travisci.
authorAndrey Petrov <andrey.petrov@shazow.net>
Mon, 25 Jul 2016 16:20:10 +0000 (12:20 -0400)
committerAndrey Petrov <andrey.petrov@shazow.net>
Mon, 25 Jul 2016 16:20:10 +0000 (12:20 -0400)
.travis.yml
Makefile

index 3b7c6b369d36b6580c97961da4c7ee35a829d890..eeda0f3c96d1b5d5d5e35118353cfd6aa551a62e 100644 (file)
@@ -1,15 +1,25 @@
-language: go
-
 notifications:
   email: false
 
+language: go
+
+go:
+  - 1.6.2
+  - tip
+
+env:
+  - CGO_ENABLED=0
+
 install:
-  - export PATH=$PATH:$HOME/gopath/bin
-  - make deps
+  - go get -t ./...
+  - go get github.com/golang/lint/golint
+  - go get github.com/gordonklaus/ineffassign
 
 script:
-  # TODO: Bring this back: - fgt golint
-  - make test
+  - diff <(echo -n) <(gofmt -s -d .)
+  - ineffassign .
+  - go vet ./...
+  - go test $(go list ./... | grep -v /vendor/)
 
-go:
-  - tip
+after_script:
+  - golint ./...
index 214d99e904a533718b3bab65cd6a7f08dae1ed8c..57d25f1fd3403ee82a09f5466ee70eee3523bf0c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,8 @@ SRCS = %.go
 VERSION := $(shell git describe --tags --dirty --always)
 LDFLAGS = LDFLAGS="-X main.Version=$(VERSION)"
 
+SUBPACKAGES := $(shell go list ./... | grep -v /vendor/)
+
 all: $(BINARY)
 
 $(BINARY): deps **/**/*.go **/*.go *.go
@@ -29,7 +31,7 @@ debug: $(BINARY) $(KEY)
        ./$(BINARY) --pprof 6060 -i $(KEY) --bind ":$(PORT)" -vv
 
 test:
-       go test -v ./...
+       go test -v $(SUBPACKAGES)
 
 release:
        GOOS=linux GOARCH=arm GOARM=6 $(LDFLAGS) ./build_release "github.com/shazow/ssh-chat/cmd/ssh-chat" README.md LICENSE