From 385340af8aabf2787a63ba8490859fcc21a87011 Mon Sep 17 00:00:00 2001 From: Andrey Petrov Date: Mon, 25 Jul 2016 12:20:10 -0400 Subject: [PATCH] Fix testing in travisci. --- .travis.yml | 28 +++++++++++++++++++--------- Makefile | 4 +++- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3b7c6b3..eeda0f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,25 @@ -language: go - notifications: email: false -install: - - export PATH=$PATH:$HOME/gopath/bin - - make deps - -script: - # TODO: Bring this back: - fgt golint - - make test +language: go go: + - 1.6.2 - tip + +env: + - CGO_ENABLED=0 + +install: + - go get -t ./... + - go get github.com/golang/lint/golint + - go get github.com/gordonklaus/ineffassign + +script: + - diff <(echo -n) <(gofmt -s -d .) + - ineffassign . + - go vet ./... + - go test $(go list ./... | grep -v /vendor/) + +after_script: + - golint ./... diff --git a/Makefile b/Makefile index 214d99e..57d25f1 100644 --- 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