Skip to content

Commit

Permalink
Add travis support
Browse files Browse the repository at this point in the history
  • Loading branch information
Yun Wang committed Oct 4, 2016
1 parent 1b558c1 commit b5014fe
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
language: go

go:
- 1.7.1
- tip

sudo: true

before_install:
- sudo add-apt-repository ppa:masterminds/glide -y && sudo apt-get update -q
- sudo apt-get install glide -y

before_script:
- make deps

script:
- make test
- make vet
- make fmt
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
GOPACKAGES=$(shell glide novendor)
GOFILES=$(shell find . -type f -name '*.go' -not -path "./vendor/*")

.PHONY: all
all: deps fmt vet test

.PHONY: deps
deps:
glide install

.PHONY: fmt
fmt:
@if [ -n "$$(gofmt -l ${GOFILES})" ]; then echo 'Please run gofmt -l -w on your code.' && exit 1; fi

.PHONY: test
test:
go test -v -race ${GOPACKAGES}

.PHONY: vet
vet:
go vet ${GOPACKAGES}

0 comments on commit b5014fe

Please sign in to comment.