59 lines
1.3 KiB
YAML
59 lines
1.3 KiB
YAML
|
|
version: '3'
|
||
|
|
|
||
|
|
tasks:
|
||
|
|
test:
|
||
|
|
desc: Run all tests
|
||
|
|
cmds:
|
||
|
|
- go test ./...
|
||
|
|
|
||
|
|
test-verbose:
|
||
|
|
desc: Run all tests with verbose output
|
||
|
|
cmds:
|
||
|
|
- go test -v ./...
|
||
|
|
|
||
|
|
test-coverage:
|
||
|
|
desc: Run tests with coverage report
|
||
|
|
cmds:
|
||
|
|
- go test -coverprofile=coverage.out ./...
|
||
|
|
- go tool cover -html=coverage.out -o coverage.html
|
||
|
|
- echo "Coverage report generated at coverage.html"
|
||
|
|
|
||
|
|
build:
|
||
|
|
desc: Build the application
|
||
|
|
cmds:
|
||
|
|
- go build -o bin/converter ./cmd/converter
|
||
|
|
|
||
|
|
run:
|
||
|
|
desc: "Run the application with parameters (usage: task run -- <amount> <from> <to>)"
|
||
|
|
deps: [build]
|
||
|
|
cmds:
|
||
|
|
- "./bin/converter {{.CLI_ARGS}}"
|
||
|
|
|
||
|
|
clean:
|
||
|
|
desc: Clean build artifacts and coverage files
|
||
|
|
cmds:
|
||
|
|
- rm -rf bin/
|
||
|
|
- rm -f coverage.out coverage.html
|
||
|
|
|
||
|
|
lint:
|
||
|
|
desc: Run linter (if available)
|
||
|
|
cmds:
|
||
|
|
- go vet ./...
|
||
|
|
- go fmt ./...
|
||
|
|
|
||
|
|
deps:
|
||
|
|
desc: Download dependencies
|
||
|
|
cmds:
|
||
|
|
- go mod download
|
||
|
|
- go mod tidy
|
||
|
|
|
||
|
|
generate-mocks:
|
||
|
|
desc: Generate mocks using mockery
|
||
|
|
cmds:
|
||
|
|
- go run github.com/vektra/mockery/v2@latest --name=RateProvider --dir=./app --output=./app/mocks
|
||
|
|
|
||
|
|
all:
|
||
|
|
desc: Run full build pipeline
|
||
|
|
deps: [deps, generate-mocks, lint, test, build]
|
||
|
|
cmds:
|
||
|
|
- echo "Build pipeline completed successfully!"
|