Add travis CI

This commit is contained in:
Derek Parker
2015-08-03 09:34:39 -05:00
parent d06abe3f2f
commit 4bae873705
3 changed files with 33 additions and 20 deletions

10
.travis.yml Normal file
View File

@ -0,0 +1,10 @@
language: go
sudo: false
os:
- linux
- osx
go:
- 1.4.2
- tip

View File

@ -1,7 +1,7 @@
.DEFAULT_GOAL=test
UNAME = $(shell uname)
UNAME=$(shell uname)
PREFIX=github.com/derekparker/delve
GOVERSION = $(shell go version)
GOVERSION=$(shell go version)
# We must compile with -ldflags="-s" to omit
# DWARF info on OSX when compiling with the
@ -10,44 +10,49 @@ GOVERSION = $(shell go version)
# unable to execute.
# See https://github.com/golang/go/issues/11887#issuecomment-126117692.
ifneq (,$(findstring 1.5, $(GOVERSION)))
FLAGS=-ldflags="-s"
FLAGS=-ldflags="-s"
endif
build:
go build $(FLAGS) github.com/derekparker/delve/cmd/dlv
# If we're on OSX make sure the proper CERT env var is set.
ifeq "$(UNAME)" "Darwin"
ifeq "$(CERT)" ""
$(error You must provide a CERT env var)
$(error You must provide a CERT environment variable in order to codesign the binary.)
endif
endif
deps:
go get -u github.com/peterh/liner
go get -u github.com/spf13/cobra
go get -u golang.org/x/sys/unix
go get -u github.com/davecheney/profile
build: deps
go build $(FLAGS) github.com/derekparker/delve/cmd/dlv
ifeq "$(UNAME)" "Darwin"
codesign -s $(CERT) ./dlv
endif
install:
install: deps
go install $(FLAGS) github.com/derekparker/delve/cmd/dlv
ifeq "$(UNAME)" "Darwin"
ifeq "$(CERT)" ""
$(error You must provide a CERT env var)
endif
codesign -s $(CERT) $(GOPATH)/bin/dlv
endif
test:
test: deps
ifeq "$(UNAME)" "Darwin"
ifeq "$(CERT)" ""
$(error You must provide a CERT env var)
endif
ifeq "$(TRAVIS)" "true"
sudo -E go test -v ./...
else
go test $(PREFIX)/terminal $(PREFIX)/dwarf/frame $(PREFIX)/dwarf/op $(PREFIX)/dwarf/util $(PREFIX)/source $(PREFIX)/dwarf/line
go test -c $(FLAGS) $(PREFIX)/proc && codesign -s $(CERT) ./proc.test && ./proc.test $(TESTFLAGS) && rm ./proc.test
go test -c $(FLAGS) $(PREFIX)/service/test && codesign -s $(CERT) ./test.test && ./test.test $(TESTFLAGS) && rm ./test.test
endif
else
go test -v ./...
endif
test-proc-run:
ifeq "$(UNAME)" "Darwin"
ifeq "$(CERT)" ""
$(error You must provide a CERT env var)
endif
go test -c $(FLAGS) $(PREFIX)/proc && codesign -s $(CERT) ./proc.test && ./proc.test -test.run $(RUN) && rm ./proc.test
else
go test $(PREFIX) -run $(RUN)
@ -55,9 +60,6 @@ endif
test-integration-run:
ifeq "$(UNAME)" "Darwin"
ifeq "$(CERT)" ""
$(error You must provide a CERT env var)
endif
go test -c $(FLAGS) $(PREFIX)/service/test && codesign -s $(CERT) ./test.test && ./test.test -test.run $(RUN) && rm ./test.test
else
go test $(PREFIX)/service/rest -run $(RUN)

View File

@ -2,6 +2,7 @@
[![license](http://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/derekparker/delve/master/LICENSE)
[![GoDoc](https://godoc.org/github.com/derekparker/delve?status.svg)](https://godoc.org/github.com/derekparker/delve)
[![Build Status](https://travis-ci.org/derekparker/delve.svg?branch=travis-ci)](https://travis-ci.org/derekparker/delve)
[![Join the chat at https://gitter.im/derekparker/delve](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/derekparker/delve?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
**This project is currently pre 1.0.**