From 0f4c57bcdea37b742016f18ca5688b71efd28f5b Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Thu, 22 Oct 2020 10:38:47 +0200 Subject: [PATCH] Cache go modules in CI --- .gitlab-ci.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6288eb7..8105ae3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,8 +2,18 @@ stages: - test - quality-assurance +.go-cache: + variables: + GOPATH: $CI_PROJECT_DIR/.go + before_script: + - mkdir -p .go + cache: + paths: + - .go/pkg/mod/ + unit_tests: image: golang:1.15-alpine + extends: .go-cache stage: test before_script: - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/community build-base ffmpeg gcc libsrt-dev @@ -18,6 +28,7 @@ unit_tests: linters: image: golang:1.15-alpine + extends: .go-cache stage: quality-assurance script: - go get -u golang.org/x/lint/golint