-
Notifications
You must be signed in to change notification settings - Fork 5
/
Taskfile.yml
76 lines (61 loc) · 1.83 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
version: '3'
silent: true
tasks:
verify:
cmds:
- which docker 12> /dev/null
- which go 12> /dev/null
- which golangci-lint 12> /dev/null
- which goveralls 12> /dev/null
- docker version >> /dev/null || (echo 'docker daemon is not running' && exit 1)
install-tools:
cmds:
- "$(cd $HOME && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.46.1)"
- "$(go install github.com/mattn/goveralls@latest)"
install:
cmds:
- go mod download
world:
cmds:
- task: verify
- task: test
- task: integration-test
- task: lint
- task: cleanup
test:
deps: [stop-device-simulation-container]
cmds:
- go test -covermode=count -coverprofile=coverage.out $(go list ./... | grep -v '/test/integration') -count=1
integration-test:
cmds:
- task: build-device-simulation-image
- task: start-device-simulation-container
- go test ./test/integration -count=1
- task: stop-device-simulation-container
build-device-simulation-image:
dir: test/device-simulation
cmds:
- docker image build -t golang-tplink-hs100:device-simulation . >> /dev/null
start-device-simulation-container:
deps: [stop-device-simulation-container]
cmds:
- docker container run -e DEBUG=* -p 9999:9999 --name tplink-device-simulation --rm -d golang-tplink-hs100:device-simulation >> /dev/null
stop-device-simulation-container:
cmds:
- docker container rm -f tplink-device-simulation &>> /dev/null || true
lint:
cmds:
- golangci-lint run
cleanup:
cmds:
- go mod verify
- go mod tidy
coveralls-analysis:
cmds:
- goveralls -coverprofile=coverage.out -service=github
sonar-analysis:
cmds:
- gover
- sonar-scanner
default:
cmds: [ task: world ]