-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (33 loc) · 978 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
38
39
40
41
ifeq ($(OS),Windows_NT)
# Windows
RM := del /s /q
MKDIR := mkdir
else
# Linux/Unix
RM := rm -rf
MKDIR := mkdir -p
endif
setup:
go install github.com/axw/gocov/gocov@latest
go install github.com/t-yuki/gocover-cobertura@latest
go install github.com/golangci/golangci-lint/cmd/[email protected]
go install github.com/vektra/mockery/[email protected]
build: setup
go mod tidy
go mod vendor
go build -o ./out/server ./app/internal/server.go
migrate:
go run ./platform/migrations/run_migrations/migrate.go
run:
go run ./app/internal/server.go
lint:
golangci-lint run
test:
$(RM) coverage
$(MKDIR) coverage
go test -race ./app/src/tests/... -count=1 -p 1 -covermode=atomic -coverprofile=coverage/coverage.out
test.cover: test
gocov convert coverage/coverage.out | gocov report 2>&1
test.report: test.cover
go tool cover -html coverage/coverage.out -o coverage/coverage.html
gocover-cobertura < coverage/coverage.out > coverage/coverage.xml