1
0
Fork 0
telegram/.gitlab-ci.yml

50 lines
957 B
YAML
Raw Permalink Normal View History

---
2018-07-29 15:41:59 +00:00
image: golang:alpine
variables:
REPO_NAME: gitlab.com/$CI_PROJECT_PATH
CGO_ENABLED: "0"
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- /go/pkg/mod
- /var/cache/apk
before_script:
- mkdir -p $GOPATH/src/$(dirname $REPO_NAME)
- ln -svf $CI_PROJECT_DIR $GOPATH/src/$REPO_NAME
- cd $GOPATH/src/$REPO_NAME
2018-07-29 15:41:59 +00:00
stages:
- test
test:
2018-07-29 15:41:59 +00:00
stage: test
before_script:
- go get gotest.tools/gotestsum
2018-07-29 15:41:59 +00:00
script:
- gotestsum --junitfile report.xml --format testname
artifacts:
when: always
reports:
junit: report.xml
2018-07-29 15:41:59 +00:00
cover:
2018-07-29 15:41:59 +00:00
stage: test
before_script:
- go get github.com/t-yuki/gocover-cobertura
2018-07-29 15:41:59 +00:00
script:
- go test -coverprofile=coverage.txt -covermode count $REPO_NAME/...
- gocover-cobertura < coverage.txt > coverage.xml
artifacts:
reports:
cobertura: coverage.xml
2018-07-29 15:41:59 +00:00
lint:
image: golangci/golangci-lint
stage: test
2018-07-29 15:41:59 +00:00
script:
- golangci-lint run $REPO_NAME/...
allow_failure: true