new build script
This commit is contained in:
parent
d440ab6302
commit
2af0898d82
1 changed files with 38 additions and 0 deletions
38
.gitlab-ci.yml
Normal file
38
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
image: golang:latest
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- test
|
||||||
|
|
||||||
|
validate lint:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- go get -u golang.org/x/lint/golint
|
||||||
|
- golint -set_exit_status ./...
|
||||||
|
|
||||||
|
execute tests:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- go test ./...
|
||||||
|
|
||||||
|
race detection:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- go test -race ./...
|
||||||
|
|
||||||
|
code coverage:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- go test -covermode=count -coverprofile coverage.cov ./...
|
||||||
|
- go tool cover -func=coverage.cov
|
||||||
|
- mkdir $CI_PROJECT_DIR/report
|
||||||
|
- go tool cover -html=coverage.cov -o $CI_PROJECT_DIR/report/coverage.html
|
||||||
|
coverage: '/\(statements\)\W+\d+\.\d+%/'
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- report/
|
||||||
|
|
||||||
|
codecov.io:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- go test -race -coverprofile=coverage.txt -covermode=atomic ./...
|
||||||
|
- bash <(curl -s https://codecov.io/bash)
|
Loading…
Add table
Reference in a new issue