forked from Versent/saml2aws
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
61 lines (48 loc) · 1.26 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
NAME=saml2aws
ARCH=$(shell uname -m)
OS=$(shell uname)
VERSION=2.28.0
ITERATION := 1
GOLANGCI_VERSION = 1.45.2
GORELEASER_VERSION = 0.157.0
SOURCE_FILES?=$$(go list ./... | grep -v /vendor/)
TEST_PATTERN?=.
TEST_OPTIONS?=
BIN_DIR := $(CURDIR)/bin
ci: prepare test
mod:
@go mod download
@go mod tidy
.PHONY: mod
lint:
@echo "--- lint all the things"
@docker run --rm -v $(shell pwd):/app -w /app golangci/golangci-lint:v$(GOLANGCI_VERSION) golangci-lint run -v
.PHONY: lint
lint-fix:
@echo "--- lint all the things"
@docker run --rm -v $(shell pwd):/app -w /app golangci/golangci-lint:v$(GOLANGCI_VERSION) golangci-lint run -v --fix
.PHONY: lint-fix
fmt: lint-fix
install:
go install ./cmd/saml2aws
.PHONY: mod
build: $(BIN_DIR)/goreleaser
ifeq ($(OS),Darwin)
$(BIN_DIR)/goreleaser build --snapshot --clean --config $(CURDIR)/.goreleaser.macos-latest.yml
else ifeq ($(OS),Linux)
$(BIN_DIR)/goreleaser build --snapshot --clean --config $(CURDIR)/.goreleaser.ubuntu-latest.yml
else
$(error Unsupported build OS: $(OS))
endif
.PHONY: build
clean:
@rm -fr ./build
.PHONY: clean
generate-mocks:
mockery -dir pkg/prompter --all
mockery -dir pkg/provider/okta -name U2FDevice
.PHONY: generate-mocks
test:
@echo "--- test all the things"
@go test -cover ./...
.PHONY: test