Compare commits

..

2 Commits

Author SHA1 Message Date
iratusmachina cdcac469d6 Merge pull request 'Adding Makefile' (#2) from feature/adding-makefile into main
Reviewed-on: #2
2024-05-06 07:28:11 +00:00
iratusmachina 6fe56f8878 Adding Makefile 2024-05-06 03:27:16 -04:00
1 changed files with 32 additions and 0 deletions

32
Makefile Normal file
View File

@ -0,0 +1,32 @@
# Inspired from https://dustinspecker.com/posts/go-combined-unit-integration-code-coverage/ and https://netdevops.me/2023/test-coverage-for-go-integration-tests/
BIN_DIR = $(CURDIR)/artifacts
BINARY = $(BIN_DIR)/gocustomurls
CURRENT_DIR = $(shell pwd)
CUR_TAG = $(shell git tag | sort -g | tail -1 | cut -c 2-)
VERSION_NUMBER ?= 0.0.0
ifneq ($(CI_COMMIT_TAG),)
VERSION_NUMBER := $(CI_COMMIT_TAG:v%=%)
else
VERSION_NUMBER := ${CUR_TAG}
endif
.PHONY: clean
clean:
go clean
.PHONY: dep
dep:
go mod tidy
.PHONY: fmt
fmt:
go fmt ./...
.PHONY: lint
lint:
golangci-lint run --timeout 3m --verbose
.PHONY: build
build:
go build -o $(BINARY)