Split test and lint for CircleCI
This commit is contained in:
parent
daec91ff2c
commit
86c787e350
1 changed files with 21 additions and 8 deletions
|
@ -1,23 +1,32 @@
|
||||||
# Golang CircleCI 2.0 configuration file
|
defaults: &defaults
|
||||||
#
|
working_directory: /go/src/github.com/hipages/php-fpm_exporter
|
||||||
# Check https://circleci.com/docs/2.0/language-go/ for more details
|
|
||||||
version: 2
|
version: 2
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build:
|
test:
|
||||||
|
<<: *defaults
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/golang:1.9
|
- image: circleci/golang:1.9
|
||||||
working_directory: /go/src/github.com/hipages/php-fpm_exporter
|
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- 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: 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: dep ensure -vendor-only
|
||||||
- run: go test -v ./...
|
- 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:
|
docker:
|
||||||
- image: circleci/golang:1.9
|
- image: circleci/golang:1.9
|
||||||
working_directory: /go/src/github.com/hipages/php-fpm_exporter
|
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- setup_remote_docker:
|
- setup_remote_docker:
|
||||||
|
@ -31,7 +40,11 @@ workflows:
|
||||||
version: 2
|
version: 2
|
||||||
build-n-deploy:
|
build-n-deploy:
|
||||||
jobs:
|
jobs:
|
||||||
- build:
|
- test:
|
||||||
|
filters:
|
||||||
|
tags:
|
||||||
|
only: /^v.*/
|
||||||
|
- lint:
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /^v.*/
|
only: /^v.*/
|
||||||
|
|
Loading…
Reference in a new issue