Add 'go test' Makefile target
Signed-off-by: Ionut Balutoiu <ibalutoiu@cloudbasesolutions.com>
This commit is contained in:
parent
3949912678
commit
8f29f90488
1 changed files with 9 additions and 2 deletions
11
Makefile
11
Makefile
|
|
@ -1,14 +1,21 @@
|
|||
SHELL := bash
|
||||
|
||||
.PHONY : build-static
|
||||
|
||||
IMAGE_TAG = garm-build
|
||||
|
||||
USER_ID=$(shell ((docker --version | grep -q podman) && echo "0" || id -u))
|
||||
USER_GROUP=$(shell ((docker --version | grep -q podman) && echo "0" || id -g))
|
||||
|
||||
GO_PACKAGES?=$(shell (go list ./... | grep -v 'vendor'))
|
||||
|
||||
default: build-static
|
||||
|
||||
.PHONY : build-static
|
||||
build-static:
|
||||
@echo Building garm
|
||||
docker build --tag $(IMAGE_TAG) .
|
||||
docker run --rm -e USER_ID=$(USER_ID) -e USER_GROUP=$(USER_GROUP) -v $(PWD):/build/garm:z $(IMAGE_TAG) /build-static.sh
|
||||
@echo Binaries are available in $(PWD)/bin
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
go test $(GO_PACKAGES) -v $(TEST_ARGS) -timeout=15m -parallel=4
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue