forked from laetho/metagraf
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathTaskfile.yml
More file actions
50 lines (43 loc) · 1021 Bytes
/
Taskfile.yml
File metadata and controls
50 lines (43 loc) · 1021 Bytes
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
# https://taskfile.dev
version: '3'
tasks:
build:
desc: build binary
env:
CGO_ENABLED: 0
vars:
GITHASH:
sh: git rev-parse --short HEAD
GITTAG:
sh: git tag -l --points-at HEAD
GITBRANCH:
sh: git rev-parse --abbrev-ref HEAD
dir: mg
sources:
- "**/*.go"
generates:
- mg
cmds:
- |
go build -ldflags "-extldflags '-static'
-X 'github.com/laetho/metagraf/pkg/mgver.GitHash={{.GITHASH}}'
-X 'github.com/laetho/metagraf/pkg/mgver.GitTag={{.GITTAG}}'
-X 'github.com/laetho/metagraf/pkg/mgver.GitBranch={{.GITBRANCH}}'"
setup:
desc: install dependencies
cmds:
- go mod tidy
test:
desc: run tests
cmds:
- go vet ./...
- go test ./... -covermode=atomic -coverpkg=./... -coverprofile=coverage.txt
cover:
desc: open the cover tool
cmds:
- go tool cover -html=coverage.txt
default:
cmds:
- task: setup
- task: test
- task: build