31 lines
768 B
YAML
31 lines
768 B
YAML
image: golang:latest
|
|
|
|
stages:
|
|
- test
|
|
#- build
|
|
|
|
test:
|
|
stage: test
|
|
before_script:
|
|
- export PATH=$PATH:$GOPATH/bin
|
|
- go install gotest.tools/gotestsum@latest
|
|
script:
|
|
- gotestsum --junitfile tests.xml -- -coverprofile=coverage.txt -covermode atomic .
|
|
after_script:
|
|
- export PATH=$PATH:$GOPATH/bin
|
|
- go install github.com/boumenot/gocover-cobertura@latest
|
|
- gocover-cobertura < coverage.txt > coverage.xml
|
|
- go tool cover -func=coverage.txt | grep "total:"
|
|
coverage: '/total:\s+\(statements\)\s+(\d+.\d+\%)/'
|
|
artifacts:
|
|
reports:
|
|
junit: tests.xml
|
|
coverage_report:
|
|
coverage_format: cobertura
|
|
path: coverage.xml
|
|
|
|
lint:
|
|
stage: test
|
|
image: golangci/golangci-lint
|
|
script:
|
|
- golangci-lint run
|