-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (22 loc) · 1.45 KB
/
Makefile
File metadata and controls
29 lines (22 loc) · 1.45 KB
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
GOBIN ?= $$(go env GOPATH)/bin
linux-build:
env GOOS=linux GOARCH=amd64 go build
doc:
go run docs/gen.go
build:
CGO_ENABLED=0 GOOS=linux go build -ldflags "-X 'github.com/flagship-io/abtasty-cli/cmd/version.Version=${ABTASTY_CLI_VERSION}'" -o abtasty-cli
test: SHELL:=/bin/bash
test:
mkdir -p coverage
GOTOOLCHAIN=go1.25.0+auto go test -v -race `go list ./... | grep -v cmd/feature-experimentation/analyze | grep -v cmd/feature-experimentation/resource | grep -v docs` -coverprofile coverage/cover.out.tmp
cat coverage/cover.out.tmp | grep -v "mock_\|cmd/feature-experimentation/analyze" | grep -v "mock_\|cmd/feature-experimentation/resource" | grep -v "mock_\|docs"> coverage/cover.out
GOTOOLCHAIN=go1.25.0+auto go tool cover -html=coverage/cover.out -o coverage/cover.html
GOTOOLCHAIN=go1.25.0+auto go tool cover -func=coverage/cover.out
.PHONY: install-go-test-coverage
install-go-test-coverage:
go install github.com/vladopajic/go-test-coverage/v2@latest
.PHONY: check-coverage
check-coverage: install-go-test-coverage
GOTOOLCHAIN=go1.25.0+auto go test -race `go list ./... | grep -v cmd/feature-experimentation/analyze | grep -v cmd/feature-experimentation/resource | grep -v docs` -coverprofile cover.out.tmp -covermode=atomic
cat coverage/cover.out.tmp | grep -v "mock_\|cmd/feature-experimentation/analyze" | grep -v "mock_\|cmd/feature-experimentation/resource | grep -v "mock_\|docs" > cover.out
${GOBIN}/go-test-coverage --config=./.testcoverage.yml