mirror of
https://github.com/outbackdingo/matchbox.git
synced 2026-01-27 18:19:36 +00:00
Replace test script with Makefile test targets
This commit is contained in:
13
.travis.yml
13
.travis.yml
@@ -3,17 +3,14 @@ sudo: required
|
||||
services:
|
||||
- docker
|
||||
go:
|
||||
- 1.10.x
|
||||
- 1.11.x
|
||||
- 1.11.5
|
||||
- tip
|
||||
matrix:
|
||||
allow_failures:
|
||||
- go: tip
|
||||
- "1.10.x"
|
||||
- "1.11.x"
|
||||
- "1.11.5"
|
||||
- "1.12.x"
|
||||
install:
|
||||
- go get golang.org/x/lint/golint
|
||||
script:
|
||||
- make test
|
||||
- make
|
||||
deploy:
|
||||
provider: script
|
||||
script: scripts/dev/travis-docker-push
|
||||
|
||||
19
Makefile
19
Makefile
@@ -7,15 +7,30 @@ REPO=github.com/coreos/matchbox
|
||||
IMAGE_REPO=coreos/matchbox
|
||||
QUAY_REPO=quay.io/coreos/matchbox
|
||||
|
||||
all: build
|
||||
.PHONY: all
|
||||
all: build test vet lint fmt
|
||||
|
||||
.PHONY: build
|
||||
build: clean bin/matchbox
|
||||
|
||||
bin/%:
|
||||
@go build -o bin/$* -v -ldflags $(LD_FLAGS) $(REPO)/cmd/$*
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
@./scripts/dev/test
|
||||
@go test ./... -cover
|
||||
|
||||
.PHONY: vet
|
||||
vet:
|
||||
@go vet -all ./...
|
||||
|
||||
.PHONY: lint
|
||||
lint:
|
||||
@golint -set_exit_status `go list ./... | grep -v pb`
|
||||
|
||||
.PHONY: fmt
|
||||
fmt:
|
||||
@test -z $$(go fmt ./...)
|
||||
|
||||
.PHONY: aci
|
||||
aci: clean build
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
PKGS=$(go list ./... | grep -v /vendor)
|
||||
FORMATTABLE=$(ls -d */ | grep -v -E '(vendor/|examples/)')
|
||||
LINTABLE=$(go list ./... | grep -v -E '(vendor/|pb$)')
|
||||
|
||||
go test $PKGS -cover
|
||||
go vet $PKGS
|
||||
|
||||
echo "Checking gofmt..."
|
||||
fmtRes=$(gofmt -l $FORMATTABLE)
|
||||
if [ -n "${fmtRes}" ]; then
|
||||
echo -e "gofmt checking failed:\n${fmtRes}"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
echo "Checking golint..."
|
||||
lintRes=$(echo $LINTABLE | xargs -n 1 golint)
|
||||
if [ -n "${lintRes}" ]; then
|
||||
echo -e "golint checking failed:\n${lintRes}"
|
||||
exit 2
|
||||
fi
|
||||
Reference in New Issue
Block a user