1- set BUILD_OUTPUT "pace.exe"
2- set BUILD_DIR "./build"
3- set VERSION "1.0.0"
4-
51default "build"
62
7- alias "b" "build"
8- alias "t" "test-all"
9- alias "d" "dev"
10-
11- globals {
12- "SHELL" "powershell.exe"
13- "SHELL_ARGS" "-NoProfile -NonInteractive -Command"
14- }
15-
16- hook "setup" {
17- description "Set up the build environment"
18- command "echo Setting up environment..."
19- env {
20- "SETUP_MODE" "verbose"
21- }
22- }
23-
24- hook "hook-name" {
25- description "description"
26- }
27-
28- hook "cleanup" {
29- description "Clean up temporary files"
30- command "echo Cleaning up temporary files..."
31- }
32-
33- hook "notify-success" {
34- description "Notify on successful build"
35- command "echo ✓ Build completed successfully!"
36- }
37-
38- hook "notify-failure" {
39- description "Notify on build failure"
40- command "echo ✗ Build failed!"
41- }
3+ set "output" "bin/pace"
424
435task "build" {
44- description "Build the Pace executable for production"
45- command "go build -o pace.exe cmd/pace/main.go"
46- before ["setup"]
47- after ["cleanup"]
48- inputs ["cmd/pace/main.go", "internal/**/*.go"]
49- outputs ["${BUILD_OUTPUT}"]
50- cache true
51-
52- on_success ["notify-success"]
53- on_failure ["notify-failure"]
54- }
55-
56- task "build-all" {
57- description "Build for multiple platforms"
58- command """
59- echo Building for Windows...
60- go build -o build/pace-windows.exe cmd/pace/main.go
61- echo Building for Linux...
62- go build -o build/pace-linux cmd/pace/main.go
63- echo Building for macOS...
64- go build -o build/pace-macos cmd/pace/main.go
65- """
66- outputs ["build/pace-windows.exe", "build/pace-linux", "build/pace-macos"]
67- }
68-
69- task "test-all" {
70- description "Run all tests in parallel"
71- dependencies ["unit-tests", "integration-tests"]
72- parallel true
73- command "echo All tests completed"
74- }
75-
76- task "unit-tests" {
77- description "Run unit tests"
78- command "go test ./internal/..."
79-
80- timeout "5m"
6+ description "Build the project"
7+ command "go build -o ${output} cmd/pace/main.go"
8+ before ["tidy", "test"]
819}
8210
83- task "integration-tests" {
84- description "Run integration tests"
85- command "go test -tags=integration ./..."
86-
87- retry 2
88- retry_delay "3s"
89- timeout "10m"
11+ hook "tidy" {
12+ description "Format the code"
13+ command "gofmt -s -w ."
9014}
9115
92- task "clean" {
93- description "Clean build artifacts"
94- command "rm -rf ${BUILD_DIR} *.exe .pace-cache"
95- silent true
96- }
97-
98- task "dev" {
99- description "Development mode with auto-rebuild"
100- command "go run cmd/pace/main.go"
101- inputs ["cmd/**/*.go", "internal/**/*.go"]
102- watch true
103- }
104-
105- task "ci" {
106- description "Continuous Integration - run all checks"
107- dependencies ["lint", "test-all", "build"]
108- command "echo CI pipeline completed"
109- continue_on_error true
110- parallel false
111- }
112-
113- task "lint" {
114- description "Run code linters"
115- command "go vet ./..."
116- timeout "2m"
117- }
118-
119- task "deploy" {
120- description "Deploy the application"
121- dependencies ["build", "test-all"]
122- command "echo Deploying version ${VERSION}..."
123-
124- env {
125- "DEPLOY_ENV" "production"
126- "VERSION" "${VERSION}"
127- }
128-
129- timeout "15m"
130- retry 1
131- retry_delay "10s"
132-
133- before ["setup"]
134- on_success ["notify-success"]
135- on_failure ["notify-failure", "cleanup"]
136- }
137-
138- task "docs" {
139- description "Generate documentation"
140- command "go doc -all > docs/API.md"
141- outputs ["docs/API.md"]
142- }
143-
144- # Benchmark task
145- task "benchmark" {
146- description "Run performance benchmarks"
147- command "go test -bench=. -benchmem ./..."
148- timeout "30m"
149- silent false
150- }
151-
152- task "echo-test" {
153- description "Test passing extra arguments to commands"
154- args {
155- required ["message"]
156- optional ["suffix"]
157- }
158- command "echo Hello from pace: $message $suffix"
159- }
160-
161- task "greet" {
162- description "Greet someone by name (usage: pace greet YourName)"
163- args {
164- required ["name"]
165- }
166- command "echo Hello $name, welcome to Pace!"
167- }
168-
169- task "deploy" {
170- description "Deploy to a specific environment"
171- args {
172- required ["environment", "version"]
173- optional ["region"]
174- }
175- command "echo Deploying version $version to $environment in region $region"
176- }
16+ hook "test" {
17+ description "Run tests"
18+ command "go test ./..."
19+ }
0 commit comments