Taskfile.yaml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # https://taskfile.dev
  2. version: "3"
  3. env:
  4. GOEXPERIMENT: greenteagc
  5. tasks:
  6. lint:
  7. desc: Run base linters
  8. cmds:
  9. - golangci-lint run --path-mode=abs --config=".golangci.yml" --timeout=5m
  10. lint-fix:
  11. desc: Run base linters and fix issues
  12. cmds:
  13. - golangci-lint run --path-mode=abs --config=".golangci.yml" --timeout=5m --fix
  14. test:
  15. desc: Run tests
  16. cmds:
  17. - go test ./... {{.CLI_ARGS}}
  18. fmt:
  19. desc: Run gofumpt
  20. cmds:
  21. - gofumpt -w .
  22. dev:
  23. desc: Run with profiling enabled
  24. env:
  25. CRUSH_PROFILE: true
  26. cmds:
  27. - go run .
  28. install:
  29. desc: Install the application
  30. cmds:
  31. - go install -v .
  32. profile:cpu:
  33. desc: 10s CPU profile
  34. cmds:
  35. - go tool pprof -http :6061 'http://localhost:6060/debug/pprof/profile?seconds=10'
  36. profile:heap:
  37. desc: Heap profile
  38. cmds:
  39. - go tool pprof -http :6061 'http://localhost:6060/debug/pprof/heap'
  40. profile:allocs:
  41. desc: Allocations profile
  42. cmds:
  43. - go tool pprof -http :6061 'http://localhost:6060/debug/pprof/allocs'
  44. schema:
  45. desc: Generate JSON schema for configuration
  46. cmds:
  47. - go run main.go schema > schema.json
  48. - echo "Generated schema.json"