-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.pgconfig.yaml
More file actions
72 lines (64 loc) · 1.74 KB
/
Taskfile.pgconfig.yaml
File metadata and controls
72 lines (64 loc) · 1.74 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
version: "3"
# GitHub Actions output grouping
output:
group:
begin: "::group::{{.TASK}}"
end: "::endgroup::"
vars:
CLI_NAME: "postgres-cli"
GOBIN: '{{.GOBIN | default "$(go env GOPATH)/bin"}}'
VERSION:
sh: git describe --tags --always --dirty 2>/dev/null || echo "dev"
GIT_COMMIT:
sh: git rev-parse --short HEAD 2>/dev/null || echo "unknown"
BUILD_DATE:
sh: date -u '+%Y-%m-%dT%H:%M:%SZ'
tasks:
build:
desc: Build the postgres-cli and install to GOBIN
vars:
GOBIN_PATH:
sh: go env GOPATH
LDFLAGS: >-
-s -w
-X 'main.Version={{.VERSION}}'
-X 'main.GitCommit={{.GIT_COMMIT}}'
-X 'main.BuildDate={{.BUILD_DATE}}'
cmds:
- echo "Building {{.CLI_NAME}} {{.VERSION}} ({{.GIT_COMMIT}})..."
- >-
go build
-ldflags "{{.LDFLAGS}}"
-o "{{.GOBIN_PATH}}/bin/{{.CLI_NAME}}"
./cmd
- echo "✅ Built and installed {{.CLI_NAME}} to {{.GOBIN_PATH}}/bin"
method: timestamp
install:
desc: Install the CLI to GOBIN (alias for build)
cmds:
- task: build
test:
desc: Run all CLI-related tests
cmds:
- echo "Running CLI tests..."
- go test ./cmd/... ./pkg/... -v -cover
- echo "✅ CLI tests passed"
ci:
desc: Run complete CI pipeline for CLI
cmds:
- task: check-dependencies
- task: build
- task: test
- echo "🎉 CLI CI pipeline completed successfully"
fmt:
desc: Format CLI code
cmds:
- echo "Formatting CLI code..."
- go fmt ./cmd/... ./pkg/...
- echo "✅ CLI code formatted"
lint:
desc: Lint CLI code
cmds:
- echo "Linting CLI code..."
- go vet ./cmd/... ./pkg/...
- echo "✅ CLI code linting completed"