Add taskfile
This commit is contained in:
parent
c37e2a312a
commit
17a695d895
59
Taskfile.yml
Normal file
59
Taskfile.yml
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
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!"
|
||||
Loading…
Reference in a new issue