-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
73 lines (62 loc) · 1.31 KB
/
Taskfile.yml
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
version: '2'
env:
GO111MODULE: on
vars:
BUILD_DIR: build
DOCKER_REPO: teliaoss/github-pr-resource
tasks:
default:
cmds:
- task: test
dependencies:
desc: Install build dependencies
cmds:
- task: go-get
vars: {REPO: github.com/maxbrunsfeld/counterfeiter, GOMOD: off}
generate:
desc: Generate test fakes
deps: [dependencies]
cmds:
- go generate ./...
sources:
- github.go
- git.go
generates:
- fakes/*.go
method: checksum
test:
desc: Run test suite
deps: [generate]
cmds:
- gofmt -s -l -w .
- go vet -v ./...
- go test -race -v ./...
e2e:
desc: Run E2E test suite
cmds:
- task: test
- go test -race -v ./... -tags=e2e
docker:
desc: Build docker image under dev tag.
cmds:
- docker build -t {{.DOCKER_REPO}}:dev .
build:
desc: Build check/in/out artifacts
cmds:
- task: test
- task: go-build
vars: {BINARY: check}
- task: go-build
vars: {BINARY: in}
- task: go-build
vars: {BINARY: out}
go-get:
cmds:
- GO111MODULE={{.GOMOD}} go get -u {{.REPO}}
go-build:
cmds:
- go build -o {{.BUILD_DIR}}/{{.BINARY}}{{exeExt}} -ldflags="-s -w" -v cmd/{{.BINARY}}/main.go
env:
CGO_ENABLED: '0'
GOOS: '{{OS}}'
GOARCH: '{{ARCH}}'