Skip to content

Commit

Permalink
add travis support
Browse files Browse the repository at this point in the history
  • Loading branch information
spinlock committed Mar 23, 2016
1 parent ee739bc commit 02430cf
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 10 deletions.
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
language: go

env:
- GO15VENDOREXPERIMENT=0

go:
- 1.5.3
- 1.4.3
- 1.3.3
- 1.6

install:
- go get -u github.com/tools/godep

script:
- make gotest
41 changes: 31 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,38 @@
all: redis-port
.DEFAULT_GOAL := build-all

godep-env:
@command -v godep 2>&1 >/dev/null || go get -u github.com/tools/godep
@GOPATH=`godep path` godep restore
export GO15VENDOREXPERIMENT=0

redis-port: godep-env
godep go build -i -o bin/redis-port ./cmd
.PHONY: godep

GODEP :=

ifndef GODEP
GODEP := $(shell \
if which godep 2>&1 >/dev/null; then \
echo "godep"; \
else \
if [ ! -x "${GOPATH}/bin/godep" ]; then \
go get -u github.com/tools/godep; \
fi; \
echo "${GOPATH}/bin/godep"; \
fi;)
endif

build-all: redis-port

godep:
@mkdir -p bin
@GOPATH=`${GODEP} path` ${GODEP} restore -v 2>&1 | while IFS= read -r line; do echo " >>>> $${line}"; done
@echo

redis-port: godep
${GODEP} go build -i -o bin/redis-port ./cmd

clean:
rm -rf bin
@rm -rf bin

distclean: clean
@rm -rf Godeps/_workspace
@rm -rf Godeps/_workspace/pkg

gotest:
godep go test -cover -v ./...
gotest: godep
${GODEP} go test ./pkg/...

0 comments on commit 02430cf

Please sign in to comment.