-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
163 lines (129 loc) Β· 3.09 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
---
# dependencies:
# - ginkgo
# - goi18n
# - golangci-lint
# - goveralls
# - yamllint
version: "3"
silent: true
dotenv: [".env"]
vars:
FORMAT: json
BINARY_NAME: nefilim
DEPLOY_DIR: ./locale/deploy
OUT_DIR: ./locale/out
L10N_DIR: ./locale/out/l10n
#
SOURCE_LANG: en-GB
SOURCE_ACTIVE: "active.{{.SOURCE_LANG}}.{{.FORMAT}}"
#
LANGUAGE_US: en-US
US_OUT_DIR: "{{.OUT_DIR}}/{{.LANGUAGE_US}}"
ACTIVE_US: "{{.BINARY_NAME}}.active.en-US.{{.FORMAT}}"
TRANSLATE_US: "{{.BINARY_NAME}}.translate.en-US.{{.FORMAT}}"
TRANSLATE_US_FILEPATH: "{{.US_OUT_DIR}}/{{.TRANSLATE_US}}"
COVER_DIR: "./"
COVER_FILE: "coverage.out"
COVER_HTML_PATH: "./coverage.html"
GINKGO_REPORT: "ginkgo.report"
tasks:
# === build ================================================
b:
cmds:
- go build ./...
# === test =================================================
# to see how to select tests by label, refer to:
# https://onsi.github.io/ginkgo/#spec-labels
#
# equal: --label-filter="foo"
# not: --label-filter="!foo"
# and: --label-filter="!foo && bar"
# or: --label-filter="!foo || bar"
# regex: --label-filter="/pattern/"
dry:
cmds:
- ginkgo -v --dry-run ./...
t:
cmds:
- go test ./...
lfs:
cmds:
- go test ./lfs
toc:
cmds:
- go test ./collections
tn:
cmds:
- go test
clean:
cmds:
- go clean
clean-t:
cmds:
- go clean -testcache
# === ginkgo ================================================
# initialise a test suite for a package. (only 1 per package)
boot:
cmds:
- ginkgo bootstrap
# run tests suites recursive
g:
cmds:
- ginkgo -r
# invoke as task gen -- <item>
gl:
cmds:
- ginkgo -r --label-filter={{.CLI_ARGS}}
# run tests suites recursive with verbose
gv:
cmds:
- ginkgo -r -v
# generate a test file for the item provided (item_test.go)
# invoke as task gen -- <item>
gen:
cmds:
- ginkgo generate {{.CLI_ARGS}}
# === watch ================================================
watchv:
cmds:
- ginkgo watch -v -r -p ./...
watchvc:
cmds:
- ginkgo watch -v -r -p ./collections
watch:
cmds:
- ginkgo watch -r -p ./...
# === lint =================================================
lint:
cmds:
- golangci-lint run
linty:
cmds:
- yamllint *.y*ml
# === coverage =============================================
cover-clean:
cmds:
- rm -rf ./coverage
cover-publish:
cmds:
- goveralls -repotoken {{.COVERALLS_TOKEN}}
cover-setup:
cmds:
- mkdir -p ./coverage
cover-ginkgo:
cmds:
- ginkgo run -r -json-report {{.GINKGO_REPORT}} -coverpkg=./... -coverprofile={{.COVER_FILE}} --output-dir {{.COVER_DIR}}
cover-show:
cmds:
- open {{.COVER_HTML_PATH}}
cover-exclude:
cmds:
- ./scripts/apply-coverage-exclusions.sh
cover:
cmds:
- task: cover-setup
- task: cover-ginkgo
- task: cover-exclude
- go tool cover -html=./coverage.out -o {{.COVER_HTML_PATH}}
- open {{.COVER_HTML_PATH}}