2020-09-27 19:21:32 +00:00
|
|
|
stages:
|
|
|
|
- test
|
|
|
|
- quality-assurance
|
|
|
|
|
2020-10-22 08:38:47 +00:00
|
|
|
.go-cache:
|
|
|
|
variables:
|
|
|
|
GOPATH: $CI_PROJECT_DIR/.go
|
|
|
|
before_script:
|
|
|
|
- mkdir -p .go
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- .go/pkg/mod/
|
|
|
|
|
2020-09-27 19:21:32 +00:00
|
|
|
unit_tests:
|
|
|
|
image: golang:1.15-alpine
|
2020-10-22 08:38:47 +00:00
|
|
|
extends: .go-cache
|
2020-09-27 19:21:32 +00:00
|
|
|
stage: test
|
|
|
|
before_script:
|
2020-10-01 07:29:25 +00:00
|
|
|
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/community build-base ffmpeg gcc libsrt-dev
|
2020-09-27 19:21:32 +00:00
|
|
|
script:
|
|
|
|
- go test -v -covermode=count -coverprofile cover.cov ./...
|
|
|
|
- go tool cover -func=cover.cov
|
2020-10-09 20:55:32 +00:00
|
|
|
- go tool cover -html=cover.cov -o coverage.html
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- coverage.html
|
|
|
|
expire_in: 1 week
|
2020-09-27 19:21:32 +00:00
|
|
|
|
|
|
|
linters:
|
|
|
|
image: golang:1.15-alpine
|
2020-10-22 08:38:47 +00:00
|
|
|
extends: .go-cache
|
2020-09-27 19:21:32 +00:00
|
|
|
stage: quality-assurance
|
|
|
|
script:
|
|
|
|
- go get -u golang.org/x/lint/golint
|
2020-10-09 20:36:02 +00:00
|
|
|
- golint -min_confidence 0.2 -set_exit_status ./...
|
2020-09-27 19:31:35 +00:00
|
|
|
allow_failure: true
|