logging/.gitlab-ci.yml

32 lines
768 B
YAML
Raw Permalink Normal View History

2019-11-05 15:17:34 +01:00
image: golang:latest
stages:
- test
#- build
test:
stage: test
2022-05-31 12:30:30 +02:00
before_script:
- export PATH=$PATH:$GOPATH/bin
- go install gotest.tools/gotestsum@latest
2019-11-05 15:17:34 +01:00
script:
2022-05-31 12:30:30 +02:00
- 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
2019-11-05 15:17:34 +01:00
2022-05-31 12:30:30 +02:00
lint:
stage: test
image: golangci/golangci-lint
2019-11-05 15:17:34 +01:00
script:
2022-05-31 12:30:30 +02:00
- golangci-lint run