-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
53 lines (40 loc) · 1.28 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
49
50
51
52
53
PKG = github.com/k1LoW/harvest
COMMIT = $$(git describe --tags --always)
OSNAME=${shell uname -s}
ifeq ($(OSNAME),Darwin)
DATE = $$(gdate --utc '+%Y-%m-%d_%H:%M:%S')
else
DATE = $$(date --utc '+%Y-%m-%d_%H:%M:%S')
endif
export GO111MODULE=on
BUILD_LDFLAGS = -X $(PKG).commit=$(COMMIT) -X $(PKG).date=$(DATE)
default: test
ci: depsdev test build integration sec
test:
go test ./... -coverprofile=coverage.out -covermode=count
sec:
gosec ./...
integration:
@cat testdata/test.yml.template | sed -e "s|__PWD__|${PWD}|" > testdata/test.yml
@./hrv fetch -c testdata/test.yml -o test.db --start-time='2019-01-01 00:00:00' -v
test `./hrv cat test.db | grep -c ''` -gt 0 || exit 1
@rm test.db
build:
go build -ldflags="$(BUILD_LDFLAGS)" ./cmd/hrv
depsdev:
go install github.com/Songmu/ghch/cmd/ghch@v0.10.2
go install github.com/Songmu/gocredits/cmd/gocredits@v0.2.0
go install github.com/securego/gosec/v2/cmd/gosec@v2.8.1
dbdoc: build
@cat testdata/test.yml.template | sed -e "s|__PWD__|${PWD}|" > testdata/test.yml
@./hrv fetch -c testdata/test.yml -o harvest.db --start-time='2019-01-01 00:00:00'
@tbls doc -f
@rm harvest.db
prerelease:
ghch -w -N ${VER}
git add CHANGELOG.md
git commit -m'Bump up version number'
git tag ${VER}
release:
goreleaser --rm-dist
.PHONY: default test