-
Notifications
You must be signed in to change notification settings - Fork 232
/
Taskfile.yml
62 lines (51 loc) · 1.45 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
version: "3"
tasks:
lint:
desc: Lint code
cmds:
- golangci-lint run -c .golangci.yml
summary: Lint the project with golangci-lint
clean:
desc: Cleans out the build, out, docs, and dist directories
cmds:
- GO111MODULE=off go clean -i
- rm -rf build out docs dist
fmt:
desc: Run `go fmt` to format the code
cmds:
- go fmt ./...
test:
desc: Run the tests
cmds:
- go test -v ./...
tidy:
desc: Run 'go mod tidy' to clean up module files.
cmds:
- go mod tidy -v
doc:
desc: run's the godocs
cmds:
- godoc -http=:6060
check-go-mod:
desc: Check go.mod is tidy
cmds:
- go mod tidy -v
- git diff --exit-code -- go.mod go.sum
vendor:
desc: go mod vendor
cmds:
- go mod vendor
build:
desc: Build main
cmds:
# LDFlags sets the segment endpoint to an empty string thus letting the analytics library set the default endpoint on its own
# Not setting the `SegmentEndpoint` variable would let the value in the code ie "http://localhost"
- go build -v -o build/$(go env GOOS)/$(go env GOARCH)/circleci -ldflags='-X github.com/CircleCI-Public/circleci-cli/telemetry.SegmentEndpoint=https://api.segment.io' .
build-linux:
desc: Build main
cmds:
- go build -v -o build/linux/amd64/circleci .
cover:
desc: tests and generates a cover profile
cmds:
- go test -race -coverprofile=coverage.txt ./...