ghostream/.gitlab-ci.yml

37 lines
825 B
YAML

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
script:
- go test -v -covermode=count -coverprofile cover.cov ./...
- go tool cover -func=cover.cov
- go tool cover -html=cover.cov -o coverage.html
artifacts:
paths:
- coverage.html
expire_in: 1 week
linters:
image: golang:1.15-alpine
extends: .go-cache
stage: quality-assurance
script:
- go get -u golang.org/x/lint/golint
- golint -min_confidence 0.2 -set_exit_status ./...
allow_failure: true