Cache go modules in CI

This commit is contained in:
Alexandre Iooss 2020-10-22 10:38:47 +02:00
parent c0820db244
commit 0f4c57bcde
No known key found for this signature in database
GPG Key ID: 6C79278F3FCDCC02
1 changed files with 11 additions and 0 deletions

View File

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