This commit is contained in:
Grigory Efimov 2023-01-11 19:59:54 +03:00 committed by Mikhail Iudin
parent 6ba6356777
commit 3bf29d8352
No known key found for this signature in database
GPG Key ID: FAAAA8BAABDFF1C0
2 changed files with 9 additions and 14 deletions

View File

@ -19,15 +19,16 @@ jobs:
- name: deps - name: deps
run: make deps run: make deps
- name: vet
run: make vet
- name: unit tests - name: unit tests
run: make test-coverage run: make test
- name: Quality Gate - Test coverage shall be above threshold - name: Quality Gate - Test coverage shall be above threshold
env: env:
TESTCOVERAGE_THRESHOLD: 0 TESTCOVERAGE_THRESHOLD: 0
run: | run: |
go test ./... -coverprofile coverage.out -covermode count
go tool cover -func coverage.out
echo "Quality Gate: checking test coverage is above threshold ..." echo "Quality Gate: checking test coverage is above threshold ..."
echo "Threshold : $TESTCOVERAGE_THRESHOLD %" echo "Threshold : $TESTCOVERAGE_THRESHOLD %"
totalCoverage=`go tool cover -func=coverage.out | grep total | grep -Eo '[0-9]+\.[0-9]+'` totalCoverage=`go tool cover -func=coverage.out | grep total | grep -Eo '[0-9]+\.[0-9]+'`

View File

@ -1,4 +1,4 @@
.PHONY: proto test test-coverage vet deps .PHONY: proto test deps
export GOPRIVATE=github.com/anytypeio export GOPRIVATE=github.com/anytypeio
export PATH:=deps:$(PATH) 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:. commonspace/spacesyncproto/protos/*.proto
protoc --gogofaster_out=$(PKGMAP):. --go-drpc_out=protolib=github.com/gogo/protobuf:. commonfile/fileproto/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: deps:
go mod download go mod download
go build -o deps storj.io/drpc/cmd/protoc-gen-go-drpc go build -o deps storj.io/drpc/cmd/protoc-gen-go-drpc
go build -o deps github.com/gogo/protobuf/protoc-gen-gogofaster go build -o deps github.com/gogo/protobuf/protoc-gen-gogofaster
test:
go test ./... --cover