forked from astronomer/astro-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (24 loc) · 910 Bytes
/
Copy pathMakefile
File metadata and controls
34 lines (24 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
GIT_COMMIT_SHORT=$(shell git rev-parse --short HEAD)
VERSION ?= SNAPSHOT-${GIT_COMMIT_SHORT}
LDFLAGS_VERSION=-X github.com/astronomer/astro-cli/version.CurrVersion=${VERSION}
OUTPUT ?= astro
PWD=$(shell pwd)
generate:
go generate -x
lint:
go run github.com/golangci/golangci-lint/cmd/golangci-lint version
go run github.com/golangci/golangci-lint/cmd/golangci-lint run --timeout 15m0s --verbose
build:
go build -o ${OUTPUT} -ldflags "${LDFLAGS_VERSION}" main.go
test:
go test -count=1 -cover -coverprofile=coverage.txt -covermode=atomic ./... -test.v
temp-astro:
cd $(shell mktemp -d) && ${PWD}/astro dev init
mock:
go run github.com/vektra/mockery/v2 --version
go run github.com/vektra/mockery/v2
.PHONY: ensure-gofumpt
ensure-gofumpt:
@command -v gofumpt >/dev/null 2>&1 || { echo "gofumpt not found, installing..."; go install mvdan.cc/gofumpt@latest; }
fmt: ensure-gofumpt
gofumpt -w .