-
-
Notifications
You must be signed in to change notification settings - Fork 150
/
Copy pathTaskfile.yml
64 lines (58 loc) · 1.9 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
version: "2"
tasks:
build:
desc: Build the project
cmds:
- go build -v -i {{.LDFLAGS}}
test:
desc: Run the full testsuite, `legacy` will be skipped
cmds:
- task: test-unit
test-unit:
desc: Run unit tests only
cmds:
- go test -short -run '{{ default ".*" .TEST_REGEX }}' {{ default "-v" .GOFLAGS }} -coverprofile=coverage_unit.txt {{ default .DEFAULT_TARGETS .TARGETS }} {{.TEST_LDFLAGS}}
check:
desc: Check fmt and lint
cmds:
- go version
- go fmt {{ default .DEFAULT_TARGETS .TARGETS }}
- test -z $(go fmt {{ default .DEFAULT_TARGETS .TARGETS }})
- echo 'test ok'
- go vet {{ default .DEFAULT_TARGETS .TARGETS }}
- echo 'vet ok'
# FIXME: too many suggestions are failing the check, I'll fix these one in
# another PR.
# - "'{{.GOLINTBIN}}' {{.GOLINTFLAGS}} {{ default .DEFAULT_TARGETS .TARGETS }}"
# - task: i18n:check
# - task: python:check
# - task: docs:check
# - task: config:check
vars:
# all modules of this project except for "gen/..." module
DEFAULT_TARGETS:
sh: echo `go list ./... | grep -v 'arduino-create-agent/gen/' | tr '\n' ' '`
# build vars
COMMIT:
sh: echo ${TRAVIS_COMMIT:-`git log -n 1 --format=%h`}
TAG:
sh: echo `git describe --tags --abbrev=0`
LDFLAGS: >
-ldflags '-X main.version={{.TAG}}
-X main.git_revision={{.COMMIT}}'
# test vars
GOFLAGS: "-timeout 10m -v -coverpkg=./... -covermode=atomic"
TEST_VERSIONSTRING: "0.0.0-alpha"
TEST_COMMIT: "deadbeef"
TEST_LDFLAGS: >
-ldflags '-X main.version={{.TEST_VERSIONSTRING}}
-X main.git_revision={{.TEST_COMMIT}}'
# check-lint vars
GOLINTBIN:
sh: go list -f {{"{{"}}".Target{{"}}"}}" golang.org/x/lint/golint
GOLINTFLAGS: "-min_confidence 0.8 -set_exit_status"
# # docs versioning
# DOCS_VERSION: dev
# DOCS_ALIAS: ""
# DOCS_REMOTE: "origin"
PRETTIER: [email protected]