Skip to content

Commit 02430cf

Browse files
committed
add travis support
1 parent ee739bc commit 02430cf

File tree

2 files changed

+47
-10
lines changed

2 files changed

+47
-10
lines changed

.travis.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
language: go
2+
3+
env:
4+
- GO15VENDOREXPERIMENT=0
5+
6+
go:
7+
- 1.5.3
8+
- 1.4.3
9+
- 1.3.3
10+
- 1.6
11+
12+
install:
13+
- go get -u github.com/tools/godep
14+
15+
script:
16+
- make gotest

Makefile

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,38 @@
1-
all: redis-port
1+
.DEFAULT_GOAL := build-all
22

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

7-
redis-port: godep-env
8-
godep go build -i -o bin/redis-port ./cmd
5+
.PHONY: godep
6+
7+
GODEP :=
8+
9+
ifndef GODEP
10+
GODEP := $(shell \
11+
if which godep 2>&1 >/dev/null; then \
12+
echo "godep"; \
13+
else \
14+
if [ ! -x "${GOPATH}/bin/godep" ]; then \
15+
go get -u github.com/tools/godep; \
16+
fi; \
17+
echo "${GOPATH}/bin/godep"; \
18+
fi;)
19+
endif
20+
21+
build-all: redis-port
22+
23+
godep:
24+
@mkdir -p bin
25+
@GOPATH=`${GODEP} path` ${GODEP} restore -v 2>&1 | while IFS= read -r line; do echo " >>>> $${line}"; done
26+
@echo
27+
28+
redis-port: godep
29+
${GODEP} go build -i -o bin/redis-port ./cmd
930

1031
clean:
11-
rm -rf bin
32+
@rm -rf bin
1233

1334
distclean: clean
14-
@rm -rf Godeps/_workspace
35+
@rm -rf Godeps/_workspace/pkg
1536

16-
gotest:
17-
godep go test -cover -v ./...
37+
gotest: godep
38+
${GODEP} go test ./pkg/...

0 commit comments

Comments
 (0)