mirror of
https://github.com/diamondburned/arikawa.git
synced 2024-11-30 18:53:30 +00:00
CI: Added test coverage
This commit is contained in:
parent
b62ba3ecc0
commit
fe9f622be9
|
@ -3,6 +3,7 @@ image: golang:alpine
|
||||||
variables:
|
variables:
|
||||||
GO111MODULE: "on"
|
GO111MODULE: "on"
|
||||||
CGO_ENABLED: "0"
|
CGO_ENABLED: "0"
|
||||||
|
COV: "/tmp/cov_results"
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- apk add git
|
- apk add git
|
||||||
|
@ -13,7 +14,10 @@ stages:
|
||||||
unit_test:
|
unit_test:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- go test -tags unit -v ./...
|
- go test -tags unit -v -coverprofile $COV ./...
|
||||||
|
- go tool cover -func $COV
|
||||||
|
| grep -F 'total:'
|
||||||
|
| sed -E 's|total:\s+\(.*?\)\s+([0-9]+\.[0-9]+%)|TEST_COVERAGE=\1|'
|
||||||
|
|
||||||
integration_test:
|
integration_test:
|
||||||
stage: test
|
stage: test
|
||||||
|
|
Loading…
Reference in a new issue