b81ea1fe29
- enable Go module support - add compile flags to ditch C compiler - enable caching per git branch Signed-off-by: Daniel Andrei Minca <mandrei17@gmail.com>
40 lines
625 B
YAML
40 lines
625 B
YAML
image: golang:alpine
|
|
|
|
variables:
|
|
GO111MOD: "on"
|
|
CGO_ENABLED: "0"
|
|
GOOS: "linux"
|
|
|
|
cache:
|
|
key: ${CI_COMMIT_REF_SLUG}
|
|
paths:
|
|
- /var/cache/apk
|
|
- /go/pkg/mod
|
|
|
|
stages:
|
|
- test
|
|
- review
|
|
|
|
before_script:
|
|
- apk add --no-cache git make
|
|
- go get github.com/golangci/golangci-lint/cmd/golangci-lint
|
|
- go install github.com/golangci/golangci-lint/cmd/golangci-lint
|
|
- make tidy
|
|
|
|
unit_tests:
|
|
stage: test
|
|
script:
|
|
- make test
|
|
|
|
code_coverage:
|
|
stage: test
|
|
script:
|
|
- make coverage
|
|
coverage: '/^coverage:\s(\d+(?:\.\d+)?%)/'
|
|
|
|
lint_code:
|
|
stage: review
|
|
script:
|
|
- make lint
|
|
allow_failure: true
|