From 51c8cad1f08bb90d1caa2fbdf58b75282130a60a Mon Sep 17 00:00:00 2001 From: Vojtech Mares Date: Sun, 12 May 2024 23:37:10 +0200 Subject: [PATCH] ci: cache go dependencies for tests --- .gitlab-ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 631e6a5..d145bd6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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: