mirror of https://github.com/docker/cli.git
Add test-coverage & codecov target and update circleci
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
883d28cfce
commit
d79d903864
|
@ -2,3 +2,5 @@
|
||||||
/build/
|
/build/
|
||||||
cli/winresources/rsrc_386.syso
|
cli/winresources/rsrc_386.syso
|
||||||
cli/winresources/rsrc_amd64.syso
|
cli/winresources/rsrc_amd64.syso
|
||||||
|
coverage.txt
|
||||||
|
profile.out
|
||||||
|
|
13
Makefile
13
Makefile
|
@ -14,6 +14,19 @@ clean:
|
||||||
test:
|
test:
|
||||||
go test -tags daemon -v $(shell go list ./... | grep -v /vendor/)
|
go test -tags daemon -v $(shell go list ./... | grep -v /vendor/)
|
||||||
|
|
||||||
|
.PHONY: test-coverage
|
||||||
|
test-coverage:
|
||||||
|
for pkg in $(shell go list ./... | grep -v /vendor/); do \
|
||||||
|
go test -tags daemon -v -cover -parallel 8 -coverprofile=profile.out -covermode=atomic $${pkg} || exit 1; \
|
||||||
|
if test -f profile.out; then \
|
||||||
|
cat profile.out >> coverage.txt && rm profile.out; \
|
||||||
|
fi; \
|
||||||
|
done
|
||||||
|
|
||||||
|
.PHONY: codecov
|
||||||
|
codecov:
|
||||||
|
$(shell curl -s https://codecov.io/bash | bash)
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
lint:
|
lint:
|
||||||
gometalinter --config gometalinter.json ./...
|
gometalinter --config gometalinter.json ./...
|
||||||
|
|
|
@ -35,7 +35,7 @@ jobs:
|
||||||
dockerfile=dockerfiles/Dockerfile.dev
|
dockerfile=dockerfiles/Dockerfile.dev
|
||||||
echo "COPY . ." >> $dockerfile
|
echo "COPY . ." >> $dockerfile
|
||||||
docker build -f $dockerfile --tag cli-builder .
|
docker build -f $dockerfile --tag cli-builder .
|
||||||
docker run cli-builder make test
|
docker run cli-builder make test-coverage codecov
|
||||||
- run:
|
- run:
|
||||||
name: "Validate Vendor and Code Generation"
|
name: "Validate Vendor and Code Generation"
|
||||||
command: |
|
command: |
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
FROM golang:1.8-alpine
|
FROM golang:1.8-alpine
|
||||||
|
|
||||||
RUN apk add -U git make bash coreutils
|
RUN apk add -U git make bash coreutils curl
|
||||||
|
|
||||||
RUN go get github.com/LK4D4/vndr && \
|
RUN go get github.com/LK4D4/vndr && \
|
||||||
cp /go/bin/vndr /usr/bin && \
|
cp /go/bin/vndr /usr/bin && \
|
||||||
|
|
Loading…
Reference in New Issue