1
0
Fork 0

ci: cache go dependencies for tests

This commit is contained in:
Vojtěch Mareš 2024-05-12 23:37:10 +02:00
parent 79632c409a
commit 51c8cad1f0
Signed by: vojtech.mares
GPG key ID: C6827B976F17240D

View file

@ -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: