Fix issues

This commit is contained in:
2025-12-24 11:39:34 +03:00
parent dc05c68ee2
commit 56848c73fd
3 changed files with 101 additions and 31 deletions

View File

@@ -4,6 +4,7 @@ SHELL := /bin/bash
REGISTRY := registry.halfakop.ru
REPOSITORY := $(NAMESPACE)/$(PACKAGE)
PLATFORM ?= --platform=linux/amd64
GOCACHE ?= $(CURDIR)/.cache/go-build
SOURCE_VERSION ?= $(shell cat VERSION)
SOURCE_COMMIT ?= $(shell git rev-parse --short=8 HEAD)
@@ -31,27 +32,27 @@ help:
download:
@echo "Download dependencies"
@go mod download
@GOCACHE=$(GOCACHE) go mod download
fix:
@echo "Fix code"
@go fix ./...
@GOCACHE=$(GOCACHE) go fix ./...
app: download fix
@echo "Build application"
@go build -ldflags "$(LDFLAGS)" -o ./${EXEC} ./src
@GOCACHE=$(GOCACHE) go build -ldflags "$(LDFLAGS)" -o ./${EXEC} ./src
tests: app
@echo "Run tests"
@go test ./...
@GOCACHE=$(GOCACHE) go test ./...
test:
@echo "Run unit tests"
@go test -count=1 ./...
@GOCACHE=$(GOCACHE) go test -count=1 ./...
test-integration:
@echo "Run integration tests (requires Docker for Postgres)"
@go test -tags=integration -count=1 ./...
@GOCACHE=$(GOCACHE) go test -tags=integration -count=1 ./...
run:
@echo "Run application"
@@ -59,7 +60,7 @@ run:
clean:
@echo "Clean build environment"
@rm -rf ./${EXEC}%
@rm -rf ./${EXEC}% $(GOCACHE)
release: clean build login push