Fix travis
This commit is contained in:
parent
91fe8ba459
commit
5696bda102
4 changed files with 33 additions and 20 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,2 +1 @@
|
||||||
/ytsync
|
bin/
|
||||||
/vendor
|
|
14
.travis.yml
14
.travis.yml
|
@ -1,5 +1,15 @@
|
||||||
os: linux
|
os: linux
|
||||||
dist: trusty
|
dist: xenial
|
||||||
language: go
|
language: go
|
||||||
|
go_import_path: github.com/lbryio/ytsync
|
||||||
|
# Only the last two Go releases are supported by the Go team with security
|
||||||
|
# updates. Any versions older than that should be considered deprecated.
|
||||||
|
# Don't bother testing with them. tip builds your code with the latest
|
||||||
|
# development version of Go. This can warn you that your code will break
|
||||||
|
# in the next version of Go. Don't worry! Later we declare that test runs
|
||||||
|
# are allowed to fail on Go tip.
|
||||||
go:
|
go:
|
||||||
- "1.10.x"
|
- 1.11.5
|
||||||
|
- master
|
||||||
|
env:
|
||||||
|
- GO111MODULE=on
|
||||||
|
|
28
Makefile
28
Makefile
|
@ -1,23 +1,25 @@
|
||||||
BINARY=ytsync
|
BINARY=prism-bin
|
||||||
|
|
||||||
DIR = $(shell cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
|
DIR = $(shell cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
|
||||||
VENDOR_DIR = vendor
|
BIN_DIR = ${DIR}/bin
|
||||||
|
IMPORT_PATH = github.com/lbryio/ytsync
|
||||||
|
|
||||||
VERSION=$(shell git --git-dir=${DIR}/.git describe --dirty --always --long --abbrev=7)
|
VERSION = $(shell git --git-dir=${DIR}/.git describe --dirty --always --long --abbrev=7)
|
||||||
LDFLAGS = -ldflags "-X main.Version=${VERSION}"
|
LDFLAGS = -ldflags "-X ${IMPORT_PATH}/meta.Version=${VERSION} -X ${IMPORT_PATH}/meta.Time=$(shell date +%s)"
|
||||||
|
|
||||||
|
|
||||||
.PHONY: build dep clean
|
.PHONY: build clean test lint
|
||||||
.DEFAULT_GOAL: build
|
.DEFAULT_GOAL: build
|
||||||
|
|
||||||
|
|
||||||
build: dep
|
build:
|
||||||
CGO_ENABLED=0 go build ${LDFLAGS} -asmflags -trimpath=${DIR} -o ${DIR}/${BINARY} *.go
|
mkdir -p ${BIN_DIR} && CGO_ENABLED=0 go build ${LDFLAGS} -asmflags -trimpath=${DIR} -o ${BIN_DIR}/${BINARY} main.go
|
||||||
|
|
||||||
dep: | $(VENDOR_DIR)
|
|
||||||
|
|
||||||
$(VENDOR_DIR):
|
|
||||||
go get github.com/golang/dep/cmd/dep && dep ensure
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
if [ -f ${DIR}/${BINARY} ]; then rm ${DIR}/${BINARY}; fi
|
if [ -f ${BIN_DIR}/${BINARY} ]; then rm ${BIN_DIR}/${BINARY}; fi
|
||||||
|
|
||||||
|
test:
|
||||||
|
go test ./... -v -cover
|
||||||
|
|
||||||
|
lint:
|
||||||
|
go get github.com/alecthomas/gometalinter && gometalinter --install && gometalinter ./...
|
|
@ -12,6 +12,8 @@ import (
|
||||||
|
|
||||||
"github.com/lbryio/lbry.go/extras/errors"
|
"github.com/lbryio/lbry.go/extras/errors"
|
||||||
"github.com/lbryio/lbry.go/extras/null"
|
"github.com/lbryio/lbry.go/extras/null"
|
||||||
|
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
Loading…
Reference in a new issue