Skip to content

Commit

Permalink
Support Travis CI (#58)
Browse files Browse the repository at this point in the history
* Add .travis.yml
* Replace from glide to dep
* Add Makefile
  • Loading branch information
knqyf263 committed Nov 12, 2017
1 parent 2962afc commit b5ebd59
Show file tree
Hide file tree
Showing 7 changed files with 202 additions and 108 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: go

go:
- 1.8
- 1.9
script:
- make dep
- make test
109 changes: 109 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@

# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"


[[constraint]]
name = "github.com/BurntSushi/toml"

[[constraint]]
name = "github.com/chzyer/readline"

[[constraint]]
name = "github.com/fatih/color"
version = "1.4.1"

[[constraint]]
name = "github.com/google/go-github"

[[constraint]]
name = "github.com/jroimartin/gocui"

[[constraint]]
name = "github.com/mattn/go-runewidth"
version = "0.0.2"

[[constraint]]
name = "github.com/spf13/cobra"

[[constraint]]
name = "golang.org/x/crypto"

[[constraint]]
name = "golang.org/x/oauth2"
44 changes: 28 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,44 +1,56 @@
.PHONY: \
all \
glide \
deps \
dep \
depup \
update \
build \
install \
lint \
vet \
fmt \
clean
fmtcheck \
clean \
pretest \
test

VERSION := $(shell git describe --tags --abbrev=0)
SRCS = $(shell git ls-files '*.go')
PKGS = $(shell go list ./... | grep -v /vendor/)

all: glide deps build
all: dep build test

glide:
go get github.com/Masterminds/glide
dep:
go get -u github.com/golang/dep/...
dep ensure

deps: glide
glide install
depup:
go get -u github.com/golang/dep/...
dep ensure -u

update: glide
glide update

build: main.go deps
build: main.go dep
go build -o pet $<

install: main.go deps
go install


lint:
@ go get -v github.com/golang/lint/golint
golint $(shell glide nv)
$(foreach file,$(SRCS),golint $(file) || exit;)

vet:
go vet $(shell glide nv)
go vet $(PKGS) || exit;

fmt:
go fmt $(shell glide nv)
gofmt -w $(SRCS)

fmtcheck:
@ $(foreach file,$(SRCS),gofmt -s -l $(file);)

clean:
go clean $(shell glide nv)

pretest: vet fmtcheck

test: pretest
go install
@ $(foreach pkg,$(PKGS), go test $(pkg) || exit;)
12 changes: 6 additions & 6 deletions dialog/util.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package dialog

func StringInSlice(a string, list []string) bool {
for _, b := range list {
if b == a {
return true
}
}
return false
for _, b := range list {
if b == a {
return true
}
}
return false
}
68 changes: 0 additions & 68 deletions glide.lock

This file was deleted.

18 changes: 0 additions & 18 deletions glide.yaml

This file was deleted.

0 comments on commit b5ebd59

Please sign in to comment.