-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (31 loc) · 1.11 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
.PHONY: test clean
default: build
BINARY_FILE_NAME=int-activitypub
COVERAGE_FILE_NAME=cover.out
COVERAGE_TMP_FILE_NAME=cover.tmp
proto:
go install github.com/golang/protobuf/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/[email protected]
PATH=${PATH}:~/go/bin protoc --go_out=plugins=grpc:. --go_opt=paths=source_relative \
api/grpc/*.proto
vet: proto
go vet
test: vet
go test -race -cover -coverprofile=${COVERAGE_FILE_NAME} ./...
cat ${COVERAGE_FILE_NAME} | grep -v _mock.go | grep -v logging.go | grep -v .pb.go > ${COVERAGE_FILE_NAME}.tmp
mv -f ${COVERAGE_FILE_NAME}.tmp ${COVERAGE_FILE_NAME}
go tool cover -func=${COVERAGE_FILE_NAME} | grep -Po '^total\:\h+\(statements\)\h+\K.+(?=\.\d+%)' > ${COVERAGE_TMP_FILE_NAME}
./scripts/cover.sh
rm -f ${COVERAGE_TMP_FILE_NAME}
build: proto
CGO_ENABLED=0 GOOS=linux GOARCH= GOARM= go build -o ${BINARY_FILE_NAME} main.go
chmod ugo+x ${BINARY_FILE_NAME}
docker:
docker build -t awakari/int-activitypub .
staging: docker
./scripts/staging.sh
release: docker
./scripts/release.sh
clean:
go clean
rm -f ${BINARY_FILE_NAME} ${COVERAGE_FILE_NAME}