-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
74 lines (61 loc) · 1.97 KB
/
Makefile
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
SHA=$(shell git rev-parse --short HEAD)
VERSION=$(shell cat VERSION)
DIRTY=false
GO_PACKAGE=$(shell go list)
LDFLAGS=-ldflags "-w -s -X $(GO_PACKAGE)/pkg/util.GitSha=${SHA} -X $(GO_PACKAGE)/pkg/util.Version=${VERSION} -X $(GO_PACKAGE)/pkg/util.Dirty=${DIRTY}"
export GO111MODULE=on
clean: ## clean the repo
rm aws-oidc 2>/dev/null || true
go clean
go clean -testcache
rm -rf dist 2>/dev/null || true
rm coverage.out 2>/dev/null || true
if [ -e /tmp/aws-oidc.lock ]; then \
rm /tmp/aws-oidc.lock; \
fi \
setup: # setup development dependencies
export GO111MODULE=on
go install github.com/goreleaser/[email protected]
go install github.com/golangci/golangci-lint/cmd/[email protected]
curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- v0.9.14
curl -sfL https://raw.githubusercontent.com/chanzuckerberg/bff/main/download.sh | sh
.PHONY: setup
install:
go install
.PHONY: install
test:
CGO_ENABLED=1 go test -race -coverprofile=coverage.txt -covermode=atomic ./...
.PHONY: test
test-all:
go test -v -coverprofile=coverage.txt -covermode=atomic ./... -tags=integration
.PHONY: test-all
test-coverage: ## run the test with proper coverage reporting
go test -coverprofile=coverage.out -covermode=atomic ./...
go tool cover -html=coverage.out
.PHONY: test-coverage
test-coverage-integration: ## run the test with proper coverage reporting
go test -coverprofile=coverage.out -covermode=atomic ./... -tags=integration
go tool cover -html=coverage.out
.PHONY: test-coverage-all
deps:
go get ./...
go mod tidy
.PHONY: deps
update:
go get -u ./...
go mod tidy
.PHONY: update
lint:
golangci-lint run -E whitespace --exclude-use-default
.PHONY: lint
lint-ci: ## run the fast go linters
./bin/reviewdog -conf .reviewdog.yml -reporter=github-pr-review
.PHONY: lint-ci
release: ## run a release
bff bump
git push
git push --tags
.PHONY: release
fmt:
goimports -w -d $$(find . -type f -name '*.go' -not -path "./vendor/*")
.PHONY: fmt