garm-provider-edge-connect/Makefile
Waldemar dadb5076f2
Some checks failed
Go Tests / go-tests (push) Failing after 1m4s
chore(provider): More cleanups.
2025-10-23 11:40:39 +02:00

40 lines
1.2 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: install-lint-deps verify go-test
install-lint-deps:
@$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.63.4
lint:
@golangci-lint run --timeout=8m --build-tags testing
go-test:
@$(GO) test -race -mod=vendor -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