blob: c3076f65152d89a6a44b6f64d02dba5d1e0c4146 (
plain) (
blame)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
SH=/bin/sh
GO=go
NPM=npm
PANDOC=pandoc
BINARY=neko
VERSION=0.3
BUILD=`git rev-parse HEAD`
LDFLAGS=-ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD}"
.PHONY: default all clean ui build install test test-race test-frontend test-e2e ui-check lint check ci run dev docs install-hooks cover coverage-html
default: build
all: clean ui ui-vanilla build docs
clean:
rm -f ${BINARY}
rm -f readme.html
ui:
cd frontend && ${NPM} install && ${NPM} run build
rm -rf web/dist/v2
mkdir -p web/dist/v2
cp -r frontend/dist/* web/dist/v2/
ui-vanilla:
cd frontend-vanilla && ${NPM} install && ${NPM} run build
build:
${GO} build ${LDFLAGS} -o ${BINARY} ./cmd/neko
install: build
cp ${BINARY} ${GOBIN}
test:
${GO} test -cover ./...
cd frontend && ${NPM} test -- --run
test-race:
${GO} test -race ./...
cover:
${GO} test -coverprofile=coverage.out ./...
${GO} tool cover -func=coverage.out
coverage-html: cover
${GO} tool cover -html=coverage.out
test-frontend:
cd frontend && ${NPM} run lint
cd frontend && ${NPM} test -- --run
# test-e2e: build
# ./scripts/run_e2e_safe.sh
ui-check: ui
git diff --exit-code web/dist/v2/
lint:
golangci-lint run
cd frontend && ${NPM} run lint
check: lint test
ci: lint test-race test-frontend ui-check
run: build
./${BINARY}
dev: build
./${BINARY} -d
install-hooks:
chmod +x scripts/install-hooks.sh
./scripts/install-hooks.sh
docs: readme.html
readme.html: README.md
${PANDOC} README.md -o readme.html
|