ci: cache go dependencies for tests
This commit is contained in:
parent
79632c409a
commit
51c8cad1f0
1 changed files with 7 additions and 0 deletions
|
|
@ -8,11 +8,18 @@ stages:
|
|||
test:
|
||||
stage: test
|
||||
image: golang:alpine
|
||||
variables:
|
||||
GOPATH: $CI_PROJECT_DIR/.go
|
||||
before_script:
|
||||
- mkdir -p .go
|
||||
script:
|
||||
- go mod download
|
||||
- go test ./... -v -coverprofile=coverage.txt -covermode count
|
||||
- go get github.com/boumenot/gocover-cobertura
|
||||
- go run github.com/boumenot/gocover-cobertura < coverage.txt > coverage.xml
|
||||
cache:
|
||||
paths:
|
||||
- .go/pkg/mod/
|
||||
artifacts:
|
||||
reports:
|
||||
coverage_report:
|
||||
|
|
|
|||
Reference in a new issue