forked from GoogleCloudPlatform/spanner-migration-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
30 lines (30 loc) · 812 Bytes
/
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
# Set GOPATH env variable if not set
ifndef $(GOPATH)
GOPATH=$(shell go env GOPATH)
export GOPATH
endif
# Build the default binary
build:
go build
# Build a static binary
build-static:
go build -a -tags osusergo,netgo -ldflags '-w -extldflags "-static"' -o harbourbridge main.go
# Create a new release for Harbourbridge.
release:
./release.sh ${VERSION}
# Update vendor dependencies
update-vendor:
go mod tidy
go mod vendor
# vendor non-go files
go install github.com/goware/modvendor@latest
$(GOPATH)/bin/modvendor -copy="**/*.c **/*.h **/*.proto" -v
git add -u
git commit -m "Update Vendor files" --no-edit
# Run unit tests
test:
go test -v ./...
# Run code coverage with unit tests
test-coverage:
go test ./... -coverprofile coverage.out -covermode count
go tool cover -func coverage.out