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:
|
test:
|
||||||
stage: test
|
stage: test
|
||||||
image: golang:alpine
|
image: golang:alpine
|
||||||
|
variables:
|
||||||
|
GOPATH: $CI_PROJECT_DIR/.go
|
||||||
|
before_script:
|
||||||
|
- mkdir -p .go
|
||||||
script:
|
script:
|
||||||
- go mod download
|
- go mod download
|
||||||
- go test ./... -v -coverprofile=coverage.txt -covermode count
|
- go test ./... -v -coverprofile=coverage.txt -covermode count
|
||||||
- go get github.com/boumenot/gocover-cobertura
|
- go get github.com/boumenot/gocover-cobertura
|
||||||
- go run github.com/boumenot/gocover-cobertura < coverage.txt > coverage.xml
|
- go run github.com/boumenot/gocover-cobertura < coverage.txt > coverage.xml
|
||||||
|
cache:
|
||||||
|
paths:
|
||||||
|
- .go/pkg/mod/
|
||||||
artifacts:
|
artifacts:
|
||||||
reports:
|
reports:
|
||||||
coverage_report:
|
coverage_report:
|
||||||
|
|
|
||||||
Reference in a new issue