-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (40 loc) · 1.47 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
# ==================================================================================== #
# DEV
# ==================================================================================== #
.PHONY: dev/app
dev/app:
air -c .air.toml &
./tailwindcss -i ./internal/server/http/web/input.css -o ./internal/server/http/web/static/css/main.css --minify --watch
# ==================================================================================== #
# BUILD
# ==================================================================================== #
## build/app: build application
.PHONY: build/app
build/app: build/template
@echo 'Building app'
go build -ldflags='-s' -o=./bin/api ./cmd/api
GOOS=linux GOARCH=amd64 go build -ldflags='-s' -o=./bin/linux_amd64/api ./cmd/api
.PHONY: build/template
build/template:
@echo 'Building templates'
templ generate
# ==================================================================================== #
# QUALITY CONTROL
# ==================================================================================== #
## audit: tidy and vendor dependencies and format, vet and test all code
.PHONY: audit
audit: vendor
@echo 'Formatting code...'
go fmt ./...
@echo 'Vetting code...'
go vet ./...
staticcheck ./...
@echo 'Running tests...'
go test -race -vet=off ./...
## vendor: tidy and vendor dependencies
.PHONY: vendor
vendor:
@echo 'Tidying and verifying module dependencies...' go mod tidy
go mod tidy
go mod verify
@echo 'Vendoring dependencies...'