-
Notifications
You must be signed in to change notification settings - Fork 5
/
Taskfile.yml
67 lines (58 loc) · 1.28 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
version: '3'
vars:
BUILD_DIR: build
DOCKER_REPO: teliaoss/github-pr-resource
tasks:
default:
cmds:
- task: test
generate:
desc: Generate test fakes
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:
# most tests are done e2e-opendoor now
# - task: test
- task: go-build
vars: {BINARY: check}
- task: go-build
vars: {BINARY: in}
- task: go-build
vars: {BINARY: out}
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}}'
ci:
desc: CI build and tests
cmds:
- task: build
- if [ -n "$(git status --porcelain)" ];then echo "Diff in generated files and/or formatting" && exit 1; fi
silent: true