-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
89 lines (77 loc) · 1.96 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
version: '3'
silent: true
tasks:
install-devtools:
desc: Install devtools if they are not already installed
cmds:
- |
if ! command -v golint &> /dev/null
then
go install golang.org/x/lint/golint@latest &> /dev/null
fi
- |
if ! command -v svu &> /dev/null
then
go install github.com/caarlos0/svu@latest &> /dev/null
fi
- |
if ! command -v git-chglog &> /dev/null
then
go install github.com/git-chglog/git-chglog/cmd/git-chglog@latest &> /dev/null
fi
run:
desc: Run the application
cmds:
- go run ./... {{.CLI_ARGS}}
lint:
desc: Run linters
deps: [install-devtools]
cmds:
- golint ./...
version:
desc: Print the version
deps: [install-devtools]
cmds:
- svu current | sed 's/^v//'
bump-version:
desc: Bump the version
deps: [install-devtools]
cmds:
- |
current_version=$(svu current | sed 's/^v//')
next_version=$(svu next | sed 's/^v//')
if [ "$current_version" == "$next_version" ]; then
echo "No new version found, skipping bump"
exit 1
fi
git-chglog -o CHANGELOG.md || true
git add CHANGELOG.md
git commit -m "chore(release): Release v$next_version"
git tag "v$next_version" -m "chore(release): Release v$next_version"
exit 0
test-lib:
desc: Run Go tests
deps: [install-devtools]
cmds:
- go test -race -cover -coverprofile=coverage.out -covermode atomic ./...
benchmark:
desc: Run Go benchmarks
cmds:
- go test -bench=. ./...
view-coverage:
desc: View test coverage
cmds:
- go tool cover -func=coverage.out
test:
desc: Run all tests
cmds:
- task: test-lib
- task: view-coverage
clean:
desc: Clean build artifacts
cmds:
- rm -rf ./bin
all:
desc: Run all components
cmds:
- task: test