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 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.*/