garm-provider-edge-connect/Makefile
Manuel Ganter 36c0b89eb5
All checks were successful
Go Tests / go-tests (push) Successful in 1m23s
chore(make): fixed makefile to use go variable instead of go in PATH
2025-11-10 16:58:17 +01:00

37 lines
1.1 KiB
Makefile

SHELL := bash
ROOTDIR=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))
GOPATH ?= $(shell go env GOPATH)
GO ?= go
IMAGE_TAG = garm-provider-build
IMAGE_BUILDER=$(shell (which docker || which podman))
USER_ID=$(shell (($(IMAGE_BUILDER) --version | grep -q podman) && echo "0" || id -u))
USER_GROUP=$(shell (($(IMAGE_BUILDER) --version | grep -q podman) && echo "0" || id -g))
GARM_PROVIDER_NAME := garm-provider-edge-connect
default: build
.PHONY : build test install-lint-deps lint go-test fmt fmtcheck verify
build:
@$(GO) build .
clean: ## Clean up build artifacts
@rm -rf ./bin ./build ./release
test: verify go-test
lint:
@$(GO) run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.63.4 run --timeout=8m --build-tags testing ./...
go-test:
@$(GO) test -race -tags testing -v $(TEST_ARGS) -timeout=15m -parallel=4 -count=1 ./...
fmt:
@$(GO) fmt $$(go list ./...)
fmtcheck:
@gofmt -l -s $$(go list ./... | sed -n 's/github.com\/cloudbase\/'$(GARM_PROVIDER_NAME)'\/\(.*\)/\1/p') | grep ".*\.go"; if [ "$$?" -eq 0 ]; then echo "gofmt check failed; please tun gofmt -w -s"; exit 1;fi
verify: lint fmtcheck