Taskfile.yaml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # https://taskfile.dev
  2. version: "3"
  3. env:
  4. CGO_ENABLED: 0
  5. GOEXPERIMENT: greenteagc
  6. tasks:
  7. lint:install:
  8. desc: Install golangci-lint
  9. cmds:
  10. - go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
  11. env:
  12. GOTOOLCHAIN: go1.25.0
  13. lint:
  14. desc: Run base linters
  15. cmds:
  16. - golangci-lint run --path-mode=abs --config=".golangci.yml" --timeout=5m
  17. env:
  18. GOEXPERIMENT: null
  19. lint-fix:
  20. desc: Run base linters and fix issues
  21. cmds:
  22. - golangci-lint run --path-mode=abs --config=".golangci.yml" --timeout=5m --fix
  23. env:
  24. GOEXPERIMENT: null
  25. build:
  26. desc: Run build
  27. cmds:
  28. - go build .
  29. generates:
  30. - crush
  31. test:
  32. desc: Run tests
  33. cmds:
  34. - go test ./... {{.CLI_ARGS}}
  35. fmt:
  36. desc: Run gofumpt
  37. cmds:
  38. - gofumpt -w .
  39. dev:
  40. desc: Run with profiling enabled
  41. env:
  42. CRUSH_PROFILE: true
  43. cmds:
  44. - go run .
  45. install:
  46. desc: Install the application
  47. cmds:
  48. - go install -v .
  49. profile:cpu:
  50. desc: 10s CPU profile
  51. cmds:
  52. - go tool pprof -http :6061 'http://localhost:6060/debug/pprof/profile?seconds=10'
  53. profile:heap:
  54. desc: Heap profile
  55. cmds:
  56. - go tool pprof -http :6061 'http://localhost:6060/debug/pprof/heap'
  57. profile:allocs:
  58. desc: Allocations profile
  59. cmds:
  60. - go tool pprof -http :6061 'http://localhost:6060/debug/pprof/allocs'
  61. schema:
  62. desc: Generate JSON schema for configuration
  63. cmds:
  64. - go run main.go schema > schema.json
  65. - echo "Generated schema.json"
  66. generates:
  67. - schema.json