refact
This commit is contained in:
parent
6ba6356777
commit
3bf29d8352
7
.github/workflows/coverage.yml
vendored
7
.github/workflows/coverage.yml
vendored
@ -19,15 +19,16 @@ jobs:
|
||||
|
||||
- name: deps
|
||||
run: make deps
|
||||
- name: vet
|
||||
run: make vet
|
||||
|
||||
- name: unit tests
|
||||
run: make test-coverage
|
||||
run: make test
|
||||
|
||||
- name: Quality Gate - Test coverage shall be above threshold
|
||||
env:
|
||||
TESTCOVERAGE_THRESHOLD: 0
|
||||
run: |
|
||||
go test ./... -coverprofile coverage.out -covermode count
|
||||
go tool cover -func coverage.out
|
||||
echo "Quality Gate: checking test coverage is above threshold ..."
|
||||
echo "Threshold : $TESTCOVERAGE_THRESHOLD %"
|
||||
totalCoverage=`go tool cover -func=coverage.out | grep total | grep -Eo '[0-9]+\.[0-9]+'`
|
||||
|
||||
16
Makefile
16
Makefile
@ -1,4 +1,4 @@
|
||||
.PHONY: proto test test-coverage vet deps
|
||||
.PHONY: proto test deps
|
||||
export GOPRIVATE=github.com/anytypeio
|
||||
export PATH:=deps:$(PATH)
|
||||
|
||||
@ -16,17 +16,11 @@ proto:
|
||||
protoc --gogofaster_out=$(PKGMAP):. --go-drpc_out=protolib=github.com/gogo/protobuf:. commonspace/spacesyncproto/protos/*.proto
|
||||
protoc --gogofaster_out=$(PKGMAP):. --go-drpc_out=protolib=github.com/gogo/protobuf:. commonfile/fileproto/protos/*.proto
|
||||
|
||||
vet:
|
||||
go vet ./...
|
||||
|
||||
test:
|
||||
go test ./... --cover
|
||||
|
||||
test-coverage:
|
||||
go test ./... -coverprofile coverage.out -covermode count
|
||||
go tool cover -func coverage.out
|
||||
|
||||
deps:
|
||||
go mod download
|
||||
go build -o deps storj.io/drpc/cmd/protoc-gen-go-drpc
|
||||
go build -o deps github.com/gogo/protobuf/protoc-gen-gogofaster
|
||||
|
||||
test:
|
||||
go test ./... --cover
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user