Merge pull request #2609 from ijc/travis

experimenting with Travis
This commit is contained in:
Ian Campbell 2017-11-01 12:17:18 +00:00 committed by GitHub
commit 239a82901e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 1 deletions

22
.travis.yml Normal file
View File

@ -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

View File

@ -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))