aboutsummaryrefslogtreecommitdiff
path: root/Go.yaml
blob: f0204ed9f7844357020a161d17ff717916243fc1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
version: "3"

tasks:
  default:
    desc: Build the application
    cmds:
      - task: build

  build:
    desc: Build the binary with optimisations
    cmds:
      - go build -ldflags="-s -w" -o {{.BINARY}} .
    sources:
      - ./**/*.go
    generates:
      - ./{{.BINARY}}

  run:
    desc: Build and run the application
    deps: [build]
    cmds:
      - ./{{.BINARY}}

  install:
    desc: Install the binary to GOPATH/bin
    deps: [build]
    cmds:
      - cp {{.BINARY}} ${GOPATH:-~/go}/bin/{{.BINARY}}

  clean:
    desc: Remove build artifacts
    cmds:
      - rm -f {{.BINARY}}
      - go clean

  test:
    desc: Run tests
    cmds:
      - go test ./...

  fmt:
    desc: Format code
    cmds:
      - iku -w . || go fmt ./...

  lint:
    desc: Run linter
    cmds:
      - golangci-lint run

  dev:
    desc: Build and run in development mode
    cmds:
      - go run .