-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (38 loc) · 1.21 KB
/
Makefile
File metadata and controls
51 lines (38 loc) · 1.21 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
export GOBIN := $(addprefix $(dir $(abspath $(lastword $(MAKEFILE_LIST)))), bin)
export GOPRIVATE=github.com/idagio
SHELL = /bin/bash
.PHONY: build
build:
go build ./...
$(GOBIN)/golangci-lint: go.mod
go install github.com/golangci/golangci-lint/cmd/golangci-lint
$(GOBIN)/air: go.mod
go install github.com/air-verse/air
$(GOBIN)/swagger: go.mod
go install github.com/go-swagger/go-swagger/cmd/swagger
ALPACA_SWAGGER_SNAPSHOT := $(shell ls upstream/alpaca/openapi/snapshots/*.yaml | sort -n | tail -1)
.PHONY: ingest-alpaca-swagger
ingest-alpaca-swagger: $(GOBIN)/swagger
rm -rf upstream/alpaca/openapi/models upstream/alpaca/openapi/client
$(GOBIN)/swagger generate client \
-f $(ALPACA_SWAGGER_SNAPSHOT) \
-t upstream/alpaca/openapi \
--name=alpaca
.PHONY: worker
worker: $(GOBIN)/air
$(GOBIN)/air --build.cmd "go build -o ./bin/worker ./cmd/worker" --build.bin "./bin/worker"
.PHONY: api
api:
go run ./cmd/api
.PHONY: lint
lint: $(GOBIN)/golangci-lint
$(GOBIN)/golangci-lint run --timeout 2m -c .golangci.yml
.PHONY: lint-fix
lint-fix: $(GOBIN)/golangci-lint
$(GOBIN)/golangci-lint run -c .golangci.yml --fix
.PHONY: test
test:
go test $(if $(path),./$(path)/...,./...)
.PHONY: format
format:
gofmt -s -w .