From 4ce0e91035da9e5116faaa5faed462b802ebd58e Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Fri, 13 Oct 2017 14:32:20 +0100 Subject: [PATCH 1/2] local-check: fail build if gofmt detects differences It seems to exit code 0 in all cases. Signed-off-by: Ian Campbell --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 42a9841d4..35ab3cbe3 100644 --- a/Makefile +++ b/Makefile @@ -74,7 +74,7 @@ test-cross: .PHONY: local-check local-build local-test local local-check: $(LINUXKIT_DEPS) - @echo gofmt... && gofmt -s -l $(filter %.go,$(LINUXKIT_DEPS)) + @echo gofmt... && o=$$(gofmt -s -l $(filter %.go,$(LINUXKIT_DEPS))) && if [ -n "$$o" ] ; then echo $$o ; exit 1 ; fi @echo govet... && go tool vet -printf=false $(filter %.go,$(LINUXKIT_DEPS)) @echo golint... && set -e ; for i in $(filter %.go,$(LINUXKIT_DEPS)); do golint $$i ; done @echo ineffassign... && ineffassign $(filter %.go,$(LINUXKIT_DEPS)) From 6aaf0328b936d4b3a08695ee76d0fdd460d0dd92 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Fri, 13 Oct 2017 14:35:46 +0100 Subject: [PATCH 2/2] Add .travis.yml Initially just building the linuxkit tool itself on linux, darwin and windows with Go 1.9 and master. Signed-off-by: Ian Campbell --- .travis.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..211274170 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,22 @@ +language: go + +go: + - 1.9.x + - master + +env: + - TRAVIS_GOOS=linux + - TRAVIS_GOOS=darwin + - TRAVIS_GOOS=windows + +script: +# We want native versions of the tools. + - go get -u github.com/golang/lint/golint + - go get -u github.com/gordonklaus/ineffassign + - export GOOS=$TRAVIS_GOOS +# FIXME: For non-linux GOOS, without running `go build -i`, vet fails with `vet: import failed: can't find import: fmt`... +# Note that `go build -i` requires write permission to GOROOT. (So it is not called in Makefile) + - go build -i github.com/linuxkit/linuxkit/src/cmd/linuxkit + - make local-check + - make local-build + - if [ "$GOOS" = "linux" ]; then make local-test ; fi