forked from Versent/saml2aws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
66 lines (50 loc) · 1.34 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
NAME=saml2aws
ARCH=$(shell uname -m)
OS=$(shell uname)
ITERATION := 1
GOLANGCI_VERSION = 1.45.2
GORELEASER := $(shell command -v goreleaser 2> /dev/null)
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:
ifndef GORELEASER
$(error "goreleaser is not available please install and ensure it is on PATH")
endif
ifeq ($(OS),Darwin)
goreleaser build --snapshot --clean --config $(CURDIR)/.goreleaser.macos-latest.yml
else ifeq ($(OS),Linux)
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