-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
78 lines (65 loc) · 1.46 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
74
75
76
77
78
# https://taskfile.dev
version: '3'
env:
IMAGE_NAME: jackbit/cluster-api-provider-kind
IMAGE_TAG: test
tasks:
default:
cmds:
- task -l
silent: true
check:
desc: Run all pre-commit hooks
cmds:
- pre-commit run -a
pre-commit:
cmds:
- pre-commit install
sources:
- .git/hooks/pre-commit
- .pre-commit-config.yaml
generates:
- .git/hooks/pre-commit
method: checksum
go-mod-download:
cmds:
- go mod tidy
- go mod verify
sources:
- go.mod
- go.sum
generates:
- go.sum
method: checksum
pre-commit-setup:
cmds:
- pip3 install pre-commit
status:
- which pre-commit
setup:
desc: Bootstrap of dev environment
preconditions:
- sh: "[ $(python3 --version | cut -d ' ' -f 2 | awk -F'.' '{print ($2 > 7) }') = 1 ]"
msg: "Required python version not found (>=3.7)"
- sh: "which go"
msg: "golang tools not found! (brew install golang)"
cmds:
- task: pre-commit-setup
- task: pre-commit
- task: go-mod-download
test:
desc: Run tests and coverage
cmds:
- go test -v ./pkg/...
test:clean:
desc: "Cleanup after tets"
cmds:
- echo "Cleanup"
docker:build:
desc: "Build test docker image"
cmds:
- docker build -t $IMAGE_NAME:$IMAGE_TAG .
docker:clean:
desc: "Clean up test docker image"
cmds:
- docker rmi -f $IMAGE_NAME:$IMAGE_TAG