-
Notifications
You must be signed in to change notification settings - Fork 21
/
tusk.yml
72 lines (68 loc) · 1.79 KB
/
tusk.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
# yaml-language-server: $schema=tusk.schema.yaml
---
tasks:
lint:
usage: Run static analysis
description: |
Run golangci-lint using the project configuration.
options:
fast:
usage: Only run fast linters
type: bool
short: f
rewrite: --fast
run: go run github.com/golangci/golangci-lint/cmd/golangci-lint run ${fast} ./...
test:
usage: Run the tests
description: |
Runs the full test suite using `go test -cover ./...`.
options:
all:
usage: Run all tests and linters
short: a
type: bool
fast:
usage: Only run fast tests
type: bool
short: f
fast-flag:
private: true
default:
when: fast
value: -short
verbose:
usage: Run the tests in verbose mode
short: v
type: bool
rewrite: -v
run:
- when: all
task:
name: lint
options:
fast: ${fast}
- command: go test -race ${fast-flag} ${verbose} ./...
- when: all
task:
name: release
options:
snapshot: true
tidy:
usage: Clean up and format the repo
run:
- go mod tidy
- go run golang.org/x/tools/cmd/goimports@latest -w .
generate:
usage: Generate tusk.schema.json from tusk.schema.yaml
run: go run ./schemagen
release:
usage: Release the latest version with goreleaser
options:
snapshot:
usage: Release without publishing or validation
type: bool
rewrite: --snapshot
run: |-
header='^## [0-9]+\.[0-9]+\.[0-9]+'
awk "/${header}/{if(!found){found=1;f=1}else{f=0}} f" CHANGELOG.md |
go run github.com/goreleaser/goreleaser --clean --release-notes /dev/stdin ${snapshot}