api/.gitlab-ci.yml

58 lines
965 B
YAML

image: registry.gitlab.com/inetmock/ci-image
cache: &global_cache
key: ${CI_COMMIT_REF_SLUG}
paths:
- .task/
- ./**/*.pb.go
policy: pull-push
stages:
- test
- build
- release
test:
stage: test
cache:
<<: *global_cache
script:
- task cli-cover-report
artifacts:
reports:
junit: out/report.xml
cobertura: out/coverage.xml
lint:
stage: test
script:
- golangci-lint run
allow_failure: true
snapshot-release:
stage: build
cache:
<<: *global_cache
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- task snapshot-release
except:
- tags
release:
stage: release
cache:
<<: *global_cache
services:
- docker:dind
only:
- tags
variables:
GIT_DEPTH: 0
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- goreleaser release --rm-dist