diff --git a/.gitignore b/.gitignore index a90cd91..eba2b56 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ *.o *.a *.so +bin/ # Folders pkg/ diff --git a/.travis.yml b/.travis.yml index 6d7e2c7..8451d16 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,22 +1,41 @@ sudo: false language: go -os: - - linux - - osx - - windows - -go: - - "1.11.x" - - master - -matrix: - allow_failures: - - go: master - install: - make setup +jobs: + include: + - stage: Lint + script: + - go build ./_example/simple-echo/main.go + - diff <(goimports -d $(find . -type f -name '*.go' -not -path "./vendor/*")) <(echo -n "") + - make lint + go: "1.11.x" + os: osx + - stage: Build + script: + - make build + go: + - "1.11.x" + - tip + os: + - linux + - osx + - windows + - stage: Unit Test + script: + - make test + go: + - "1.11.x" + - tip + os: + - linux + - osx + - windows + allow_failures: + - go: tip + script: - go build ./_example/simple-echo/main.go - diff <(goimports -d $(find . -type f -name '*.go' -not -path "./vendor/*")) <(echo -n "") diff --git a/Makefile b/Makefile index deb6c92..c275a87 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,14 @@ cover: ## Run the tests. @go test -coverprofile=coverage.o @go tool cover -func=coverage.o +.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 + .PHONY: help help: ## Show help text @echo "Commands:"