-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
43 lines (35 loc) · 924 Bytes
/
Taskfile.yml
File metadata and controls
43 lines (35 loc) · 924 Bytes
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
# https://taskfile.dev
version: "3"
dotenv: [".env"]
tasks:
default:
desc: "default task"
cmds:
- task -a
vet:
desc: "go vet"
cmds:
- go vet ./...
test:
desc: "go test"
cmds:
- |
pkgs=$(go list -json ./... | awk '
/^\}/ { if (pkg != "" && has_test == 1) print pkg; pkg = ""; has_test = 0; next }
/"ImportPath":/ { gsub(/[",]/, "", $2); pkg = $2 }
/"TestGoFiles": \[/ { has_test = 1 }
/"XTestGoFiles": \[/ { has_test = 1 }
')
go test -short -race -v -cover $pkgs
lint:
desc: "golangci-lint"
cmds:
- golangci-lint run --verbose ./...
pr:current:
desc: "get PR of current branch"
cmds:
- bash scripts/get-current-pr.sh
pr:ensure-draft:
desc: "get current branch PR or create draft if missing"
cmds:
- bash scripts/get-current-pr.sh --ensure-draft --base main