-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
64 lines (53 loc) · 1.42 KB
/
Taskfile.yml
File metadata and controls
64 lines (53 loc) · 1.42 KB
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
---
version: "3.40"
vars:
SOURCES:
sh: find . -name "*.go" -type f -not -path "./.devenv/*" -not -path "./.direnv/*" | xargs echo
PACKAGES:
sh: go list ./... | xargs echo
tasks:
clean:
desc: Remove all temporary artifacts
cmds:
- go clean -i ./...
fmt:
desc: Run standard formatter
cmds:
- gofmt -s -w {{ .SOURCES }}
vet:
desc: Run vet linting
cmds:
- go vet {{ .PACKAGES }}
lint:
desc: Run revive linting
cmds:
- for PKG in {{ .PACKAGES }}; do go tool github.com/mgechev/revive -config revive.toml -set_exit_status $PKG || exit 1; done;
golangci:
desc: Run golangci linter
cmds:
- go tool github.com/golangci/golangci-lint/v2/cmd/golangci-lint run ./...
generate:
desc: Generate code
cmds:
- go generate {{ .PACKAGES }}
openapi:
desc: Generate client
cmds:
- go tool github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -templates hack/templates/ -generate types,client -package kleister -o kleister/gen.go https://dl.kleister.eu/openapi/{{ .SPEC_VERSION }}.yaml
vars:
SPEC_VERSION: 1.0.0-alpha1
test:
desc: Run tests
cmds:
- go test -coverprofile coverage.out {{ .PACKAGES }}
build:
desc: Build artifacts
cmds:
- go build -v
-tags 'netgo'
-ldflags '-s -w -extldflags "-static"'
-o /dev/null
./...
env:
CGO_ENABLED: "0"
...