forked from illacloud/builder-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (25 loc) · 909 Bytes
/
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
.PHONY: build all test clean
all: build build-websocket-server
build: build-http-server build-websocket-server
build-http-server:
go build -o bin/illa-builder-backend cmd/http-server/main.go cmd/http-server/wire_gen.go cmd/http-server/server.go
build-websocket-server:
go build -o bin/illa-builder-backend-ws cmd/websocket-server/main.go
test:
PROJECT_PWD=$(shell pwd) go test -race ./...
test-cover:
go test -cover --count=1 ./...
cover-total:
go test -cover --count=1 ./... -coverprofile cover.out
go tool cover -func cover.out | grep total
cov:
PROJECT_PWD=$(shell pwd) go test -coverprofile cover.out ./...
go tool cover -html=cover.out -o cover.html
fmt:
@gofmt -w $(shell find . -type f -name '*.go' -not -path './*_test.go')
fmt-check:
@gofmt -l $(shell find . -type f -name '*.go' -not -path './*_test.go')
init-database:
/bin/bash scripts/postgres-init.sh
clean:
@ro -fR bin