-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (54 loc) · 1.51 KB
/
Makefile
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
docker_tag=latest
skip_pull=false
all=false
clean:
rm -f coverage.out
rm -f coverage.html
rm -f test-report.json
rm -rf bin
go clean -testcache
check:
ifeq ($(all), true)
yamllint -d relaxed .circleci render.yaml build --no-warnings
${GOPATH}/bin/staticcheck ./...
endif
gofmt -l -w -s .
go vet ./...
go test -v ./... -tags test -race -coverprofile=coverage.out
go tool cover -html=coverage.out -o coverage.html
coveralls:
go test -v ./... -tags test -covermode=count -coverprofile=coverage.out -json > test-report.json
go install github.com/mattn/goveralls
${GOPATH}/bin/goveralls -coverprofile=coverage.out
run-api:
go build -o bin/ ./...
./bin/app
run-plugin:
go build -o bin/ ./...
./bin/plugin
build-all:
gofmt -l -w -s .
go vet ./...
go test -v ./... -tags test
mkdir -p bin
go build -o bin/ ./...
integration-test:
go test -v ./... -tags integration
docker-build-plugin:
docker build -t devatherock/vela-template-tester:$(docker_tag) \
-f build/Plugin.Dockerfile .
functional-test-plugin:
ifneq ($(skip_pull), true)
docker pull devatherock/vela-template-tester:$(docker_tag)
endif
go test -v ./... -tags functional
docker-build-api:
docker build -t devatherock/vela-template-tester-api:$(docker_tag) \
-f build/Api.Dockerfile .
functional-test-api:
ifneq ($(skip_pull), true)
docker pull devatherock/vela-template-tester-api:$(docker_tag)
endif
DOCKER_TAG=$(docker_tag) docker compose -f build/docker-compose.yml up --wait
go test -v ./... -tags api
docker-compose -f build/docker-compose.yml down