Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
80 lines (68 loc) · 2.85 KB
/
Copy pathTaskfile.yml
File metadata and controls
80 lines (68 loc) · 2.85 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: "3"
vars:
GOLANGCI_LINT_VERSION: v2.12.2
DEADCODE_VERSION: v0.38.0
GOVULNCHECK_VERSION: v1.1.4
GORELEASER_VERSION: v2.12.7
tasks:
default:
desc: List all available tasks
silent: true
cmds:
- task --list
build:
desc: Build the Kaiten CLI
cmds:
- go build -o bin/kaiten ./cmd/kaiten
lint:
desc: Lint the CLI
cmds:
- go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@{{.GOLANGCI_LINT_VERSION}} run ./...
fix:
desc: Lint and fix the CLI
cmds:
- go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@{{.GOLANGCI_LINT_VERSION}} run --fix ./...
fmt:
desc: Format the CLI (gofumpt + gci, the formatters .golangci.yml declares)
cmds:
- go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@{{.GOLANGCI_LINT_VERSION}} fmt ./...
test:
desc: Run CLI tests
cmds:
- go test -race -shuffle=on -cover ./...
deadcode:
desc: Report functions no test or entry point can reach
cmds:
# -test counts the test binaries as entry points too, so a helper only the tests
# reach is not reported as dead.
- go run golang.org/x/tools/cmd/deadcode@{{.DEADCODE_VERSION}} -test ./...
vuln:
desc: Scan dependencies and reachable code for known vulnerabilities
cmds:
- go run golang.org/x/vuln/cmd/govulncheck@{{.GOVULNCHECK_VERSION}} ./...
release:check:
desc: Validate .goreleaser.yaml and the install scripts without building anything
cmds:
# The release pipeline only runs once a release pull request merges, so a broken
# config is otherwise discovered at the worst possible moment. These are the
# checks CI's lint job runs, on demand.
- go run github.com/goreleaser/goreleaser/v2@{{.GORELEASER_VERSION}} check
- shellcheck --shell=sh install/install.sh
- >-
pwsh -NoProfile -Command '
$tokens = $null; $errors = $null;
[void][System.Management.Automation.Language.Parser]::ParseFile("install/install.ps1", [ref]$tokens, [ref]$errors);
if ($errors) { $errors | ForEach-Object { Write-Error $_.ToString() }; exit 1 }'
release:snapshot:
desc: Build every archive and package into dist/ without publishing
cmds:
# Everything a tag would release, from the working tree, without a tag or
# a registry: six binaries, the archives and .deb/.rpm/.apk. Docker is
# skipped because the arm64 image needs QEMU; CI has it, a laptop may not.
- go run github.com/goreleaser/goreleaser/v2@{{.GORELEASER_VERSION}} release --snapshot --clean --skip=publish,docker
coverage:
desc: Write a coverage profile to coverage.out
cmds:
# atomic rather than set: -race requires it, and the same profile feeds both.
- go test ./... -coverprofile=coverage.out -covermode=atomic