-
Notifications
You must be signed in to change notification settings - Fork 39
/
tasks.yaml
86 lines (74 loc) 路 1.86 KB
/
tasks.yaml
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
output: cockpit
pipelines:
build:
- name: Build "darwin"
task: build
env:
GOOS: darwin
BIN_OUT: bin/taskctl_darwin_amd64
- name: Build "linux"
task: build
env:
GOOS: linux
BIN_OUT: bin/taskctl_linux_amd64
fixcs:
- task: goimports
dir: "{{.Root}}"
- task: gofmt
dir: "{{.Root}}"
depends_on: goimports
prepare:
- task: tidy
- task: test
- task: goimports
depends_on: test
- task: gofmt
depends_on: goimports
- pipeline: lints
- task: update-completers
depends_on: test
lints:
- task: golint
- task: govet
depends_on: golint
tasks:
test:
command:
- go test ./...
build:
command:
- GOOS=${GOOS} GOARCH=amd64 go build -o bin/taskctl_${GOOS} ./cmd/taskctl
variations:
- GOOS: linux
- GOOS: darwin
- GOOS: windows
golint:
command:
- golint $(go list ./... | grep -v /vendor/)
govet:
command:
- go vet $(go list ./... | grep -v /vendor/)
goimports:
command:
- goimports -v -local github.com/taskctl/taskctl -w -format-only $(ls -d internal/**/*.go)
- goimports -v -local github.com/taskctl/taskctl -w -format-only $(ls -d pkg/**/*.go)
- goimports -v -local github.com/taskctl/taskctl -w -format-only $(ls -d cmd/**/*.go)
goreleaser:
command:
- goreleaser --debug --rm-dist
gofmt:
dir: "{{.Root}}"
command:
- go fmt -x ./...
- gofmt -s -w cmd/**/*.go
- gofmt -s -w internal/**/*.go
- gofmt -s -w pkg/**/*.go
tidy:
command:
- go mod tidy
update-completers:
dir: "{{.Root}}/cmd/taskctl"
command:
- rm -rf ../../autocomplete/*
- go run . completion bash > ./../../autocomplete/bash_completion.bash
- go run . completion zsh > ./../../autocomplete/zsh_completion.zsh