add “test” target and make CI use it

Signed-off-by: Gaetan de Villele <gdevillele@gmail.com>
This commit is contained in:
Gaetan de Villele 2017-04-27 15:57:35 -07:00
parent e8d0ecdf7e
commit 4d4203f7fd
3 changed files with 10 additions and 0 deletions

View File

@ -12,6 +12,11 @@ build: clean
clean:
@rm -rf ./build
# run go test
# the "-tags daemon" part is temporary
test:
@go test -tags daemon -v $(shell go list ./... | grep -v /vendor/)
# build the CLI for multiple architectures
cross: clean
@gox -output build/docker-{{.OS}}-{{.Arch}} \

View File

@ -21,6 +21,10 @@ build: build_docker_image
clean: build_docker_image
@docker run --rm -v `pwd`:/go/src/github.com/docker/cli $(DEV_DOCKER_IMAGE_NAME) make clean
# run go test
test: build_docker_image
@docker run --rm -v `pwd`:/go/src/github.com/docker/cli $(DEV_DOCKER_IMAGE_NAME) make test
# build the CLI for multiple architectures using a container
cross: build_docker_image
@docker run --rm -v `pwd`:/go/src/github.com/docker/cli $(DEV_DOCKER_IMAGE_NAME) make cross

View File

@ -25,5 +25,6 @@ ENV CGO_ENABLED=0
WORKDIR /go/src/github.com/docker/cli
RUN make cross
RUN make test
CMD sh