forked from rliebz/tusk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tusk.yml
110 lines (104 loc) · 3.08 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
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
---
tasks:
bootstrap:
usage: Set up app dependencies for first time use
description: |
Install all dependencies for building and testing the application.
options:
bin-dir:
usage: The location for binary files. Defaults to $GOPATH/bin
default: $(go env GOPATH)/bin
golangci-url:
private: true
default: https://install.goreleaser.com/github.com/golangci/golangci-lint.sh
run:
- curl -sfL ${golangci-url} | bash -s -- -b $(go env GOPATH)/bin v1.12.2
lint:
usage: Run static analysis
description: |
Runs golangci-lint using the configuration specified in .golangci.toml
options:
fast:
usage: Only run fast linters
type: bool
short: f
opts:
private: true
default:
when: fast
value: --fast
run: golangci-lint run ${opts} ./...
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
default: false
fast:
usage: Only run fast tests
type: bool
verbose:
usage: Run the tests in verbose mode
short: v
type: bool
verbose-string:
private: true
default:
when: verbose
value: -v
short-string:
private: true
default:
when: fast
value: -short
run:
- when: all
task:
name: lint
options:
fast: ${fast}
- command: go test -cover -race ${verbose-string} ${short-string} ./...
circleci:
usage: Run the circleci build locally
description: |
Alternative to `tusk test`.
Download the circleci agent if needed and run `circleci build`. This will
spin up a docker container locally and run linters and tests in an
environment that more closely resembles the pipeline run on CircleCI, but
is not easily configurable.
Requires docker to be running locally.
options:
bin-path:
private: true
default: /usr/local/bin/circleci
download-path:
private: true
default: https://circle-downloads.s3.amazonaws.com/releases/build_agent_wrapper/circleci
no-install:
usage: Do not install the CLI locally if not already available
type: bool
run:
- when:
- not-equal: {no-install: true}
- command: '! command -v circleci'
command: curl -o ${bin-path} ${download-path} && chmod +x ${bin-path}
- command: circleci build
release:
usage: Release the latest version with goreleaser
options:
snapshot:
usage: Release without publishing or validation
type: bool
snapshot-flags:
private: true
default:
when: snapshot
value: --snapshot
run: |
header='^## [0-9]+\.[0-9]+\.[0-9]+'
awk "/${header}/{if(!found){found=1;f=1}else{f=0}} f" CHANGELOG.md |
goreleaser --rm-dist --release-notes /dev/stdin ${snapshot-flags}