Split test and lint for CircleCI

This commit is contained in:
Enrico Stahn 2018-02-25 10:18:47 +11:00
parent daec91ff2c
commit 86c787e350
No known key found for this signature in database
GPG key ID: 5263621C269A50DE

View file

@ -1,23 +1,32 @@
# Golang CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-go/ for more details
defaults: &defaults
working_directory: /go/src/github.com/hipages/php-fpm_exporter
version: 2
jobs:
build:
test:
<<: *defaults
docker:
- image: circleci/golang:1.9
working_directory: /go/src/github.com/hipages/php-fpm_exporter
steps:
- checkout
- run: curl -L -s https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 -o /go/bin/dep && chmod +x /go/bin/dep
- run: dep ensure -vendor-only
- run: go test -v ./...
deploy:
lint:
<<: *defaults
docker:
- image: circleci/golang:1.9
steps:
- checkout
- run: curl -L -s https://github.com/alecthomas/gometalinter/releases/download/v2.0.5/gometalinter-2.0.5-linux-amd64.tar.gz | tar xvfz - -C /go/bin/ --strip 1
- run: gometalinter ./...
deploy:
<<: *defaults
docker:
- image: circleci/golang:1.9
working_directory: /go/src/github.com/hipages/php-fpm_exporter
steps:
- checkout
- setup_remote_docker:
@ -31,7 +40,11 @@ workflows:
version: 2
build-n-deploy:
jobs:
- build:
- test:
filters:
tags:
only: /^v.*/
- lint:
filters:
tags:
only: /^v.*/