Update .travis.yml (#114)
* Update .travis.yml * Add build.sh for examples * Update goimports * update travis.yml
This commit is contained in:
parent
b6d2b439b9
commit
b47e013727
21
.travis.yml
21
.travis.yml
|
@ -11,22 +11,35 @@ os:
|
|||
- windows
|
||||
|
||||
install:
|
||||
- make setup
|
||||
- go get -u golang.org/x/lint/golint
|
||||
- go get -u golang.org/x/tools/cmd/goimports
|
||||
- go get -u github.com/golang/dep/cmd/dep
|
||||
- dep ensure
|
||||
|
||||
stages:
|
||||
- lint
|
||||
- examples
|
||||
- test
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- stage: Lint
|
||||
- stage: lint
|
||||
script:
|
||||
- diff <(goimports -d $(find . -type f -name '*.go' -not -path "./vendor/*")) <(echo -n "")
|
||||
- make lint
|
||||
go: "1.11.x"
|
||||
os: osx
|
||||
- stage: examples
|
||||
script:
|
||||
- ./_example/build.sh
|
||||
go: "1.11.x"
|
||||
os: osx
|
||||
|
||||
script:
|
||||
- make test
|
||||
- make build
|
||||
- go test -race ./...
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- go: tip
|
||||
- os: windows
|
||||
|
|
12
Makefile
12
Makefile
|
@ -1,5 +1,7 @@
|
|||
.DEFAULT_GOAL := help
|
||||
|
||||
SOURCES := $(shell find . -path ./vendor -prune -o -name "*.go" -not -name '*_test.go' -print)
|
||||
|
||||
.PHONY: setup
|
||||
setup: ## Setup for required tools.
|
||||
go get -u golang.org/x/lint/golint
|
||||
|
@ -9,8 +11,8 @@ setup: ## Setup for required tools.
|
|||
dep ensure
|
||||
|
||||
.PHONY: fmt
|
||||
fmt: ## Formatting source codes.
|
||||
@goimports -w $(find . -type f -name '*.go' -not -path "./vendor/*")
|
||||
fmt: $(SOURCES) ## Formatting source codes.
|
||||
@goimports -w $^
|
||||
|
||||
.PHONY: lint
|
||||
lint: ## Run golint and go vet.
|
||||
|
@ -29,11 +31,7 @@ cover: ## Run the tests.
|
|||
|
||||
.PHONY: build
|
||||
build: ## Build example command lines.
|
||||
go build -o bin/exec-command ./_example/exec-command/main.go
|
||||
go build -o bin/http-prompt ./_example/http-prompt/main.go
|
||||
go build -o bin/live-prefix ./_example/live-prefix/main.go
|
||||
go build -o bin/simple-echo ./_example/simple-echo/main.go
|
||||
go build -o bin/simple-echo-cjk-cyrillic ./_example/simple-echo/cjk-cyrillic/main.go
|
||||
./_example/build.sh
|
||||
|
||||
.PHONY: help
|
||||
help: ## Show help text
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
DIR=$(cd $(dirname $0); pwd)
|
||||
BIN_DIR=$(cd $(dirname $(dirname $0)); pwd)/bin
|
||||
|
||||
mkdir -p ${BIN_DIR}
|
||||
go build -o ${BIN_DIR}/exec-command ${DIR}/exec-command/main.go
|
||||
go build -o ${BIN_DIR}/http-prompt ${DIR}/http-prompt/main.go
|
||||
go build -o ${BIN_DIR}/live-prefix ${DIR}/live-prefix/main.go
|
||||
go build -o ${BIN_DIR}/simple-echo ${DIR}/simple-echo/main.go
|
||||
go build -o ${BIN_DIR}/simple-echo-cjk-cyrillic ${DIR}/simple-echo/cjk-cyrillic/main.go
|
|
@ -4,7 +4,7 @@ import (
|
|||
"os"
|
||||
"os/exec"
|
||||
|
||||
"github.com/c-bata/go-prompt"
|
||||
prompt "github.com/c-bata/go-prompt"
|
||||
)
|
||||
|
||||
func executor(t string) {
|
||||
|
|
|
@ -10,7 +10,7 @@ import (
|
|||
"path"
|
||||
"strings"
|
||||
|
||||
"github.com/c-bata/go-prompt"
|
||||
prompt "github.com/c-bata/go-prompt"
|
||||
)
|
||||
|
||||
type RequestContext struct {
|
||||
|
|
|
@ -3,7 +3,7 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/c-bata/go-prompt"
|
||||
prompt "github.com/c-bata/go-prompt"
|
||||
)
|
||||
|
||||
var LivePrefixState struct {
|
||||
|
|
|
@ -3,7 +3,7 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/c-bata/go-prompt"
|
||||
prompt "github.com/c-bata/go-prompt"
|
||||
)
|
||||
|
||||
func executor(in string) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package main
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/c-bata/go-prompt"
|
||||
prompt "github.com/c-bata/go-prompt"
|
||||
)
|
||||
|
||||
func completer(in prompt.Document) []prompt.Suggest {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/c-bata/go-prompt"
|
||||
prompt "github.com/c-bata/go-prompt"
|
||||
"github.com/c-bata/go-prompt/completer"
|
||||
)
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"syscall"
|
||||
|
||||
"github.com/c-bata/go-prompt"
|
||||
prompt "github.com/c-bata/go-prompt"
|
||||
"github.com/pkg/term/termios"
|
||||
)
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import (
|
|||
"path/filepath"
|
||||
"runtime"
|
||||
|
||||
"github.com/c-bata/go-prompt"
|
||||
prompt "github.com/c-bata/go-prompt"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"log"
|
||||
"strings"
|
||||
|
||||
"github.com/mattn/go-runewidth"
|
||||
runewidth "github.com/mattn/go-runewidth"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"strings"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/mattn/go-runewidth"
|
||||
runewidth "github.com/mattn/go-runewidth"
|
||||
)
|
||||
|
||||
// Document has text displayed in terminal and cursor position.
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
"unicode/utf8"
|
||||
"unsafe"
|
||||
|
||||
"github.com/mattn/go-tty"
|
||||
tty "github.com/mattn/go-tty"
|
||||
)
|
||||
|
||||
const maxReadBytes = 1024
|
||||
|
|
|
@ -5,7 +5,7 @@ package prompt
|
|||
import (
|
||||
"io"
|
||||
|
||||
"github.com/mattn/go-colorable"
|
||||
colorable "github.com/mattn/go-colorable"
|
||||
)
|
||||
|
||||
// WindowsWriter is a ConsoleWriter implementation for Win32 console.
|
||||
|
|
Loading…
Reference in New Issue