-
Notifications
You must be signed in to change notification settings - Fork 20
/
Taskfile.yml
106 lines (88 loc) · 2.08 KB
/
Taskfile.yml
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
version: "3"
tasks:
build:
desc: Build server binary.
cmds:
- task: build:server
build:all:
desc: Build all binaries
cmds:
- task: build:parser
- task: build:server
- task: build:test-tree-sitter
build:do:
internal: true
cmds:
- bash -c "go build {{.BUILD_FLAGS}} -o {{.BIN_PATH}}{{if eq OS "windows"}}'.exe'{{end}} {{.GO_FILE}}"
vars:
BUILD_FLAGS: '{{default "" .BUILD_FLAGS}}'
build:parser:
cmds:
- task: build:do
vars:
BIN_PATH: bin/parser
GO_FILE: cmd/parse_yaml/parse_yaml.go
build:server:
desc: Build server binary
cmds:
- task: build:do
vars:
BIN_PATH: bin/start_server
GO_FILE: cmd/start_server/start_server.go
build:server:debug:
desc: Build server binary without optimizations
cmds:
- task: build:do
vars:
BIN_PATH: bin/start_server
BUILD_FLAGS: -gcflags='all=-N -l'
GO_FILE: cmd/start_server/start_server.go
build:test-tree-sitter:
cmds:
- task: build:do
vars:
BIN_PATH: bin/test-tree-sitter
GO_FILE: cmd/test_tree-sitter/test_tree-sitter.go
run:
cmds:
- go run cmd/start_server/start_server.go
start:
cmds:
- ./bin/start_server
env:
PORT: '{{.PORT | default 10001}}'
SCHEMA_LOCATION: ./publicschema.json
init:
- go install github.com/automation-co/husky@latest
- go get -d ./...
- husky install
licenses:
- go-licenses csv ./cmd/start_server >licenses.csv 2>licenses.errors
lint:
cmds:
- task: lint:go
lint:go:
cmds:
- gofmt -w pkg
prepare:vscode:
dir: editors/vscode
cmds:
- yarn install --immutable
- yarn run build
test:
cmds:
- task: test:go
test:all:
cmds:
- task: test:go
test:go:
cmds:
- go test ./... -count=1
validate:
desc: Run all necessary task to build, lint and test the project
deps:
- prepare:vscode
cmds:
- task: lint
- task: build:all
- task: test