php-fpm-exporter/.circleci/config.yml

64 lines
1.7 KiB
YAML

version: 2
jobs:
test:
docker:
- image: circleci/golang:1.12
steps:
- checkout
- run:
name: Install Code Climate test-reporter
command: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- run:
name: Install gometalinter
command: curl -L https://git.io/vp6lP | sudo BINDIR=/go/bin sh
- run: make deps lint test-coverage
- run:
name: Upload Code coverage
command: |
sed -i 's#github.com/hipages/php-fpm_exporter/##' .cover/cover.out
./cc-test-reporter format-coverage -t gocov .cover/cover.out
./cc-test-reporter upload-coverage
semantic-release:
docker:
- image: circleci/node:10
steps:
- checkout
- run: yarn global add --no-progress --non-interactive "semantic-release" "@semantic-release/exec"
- run: $(yarn global bin)/semantic-release
deploy:
docker:
- image: circleci/golang:1.12
steps:
- checkout
- setup_remote_docker
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
- run: curl -sL https://git.io/goreleaser | bash
workflows:
version: 2
build-n-deploy:
jobs:
- test:
filters:
tags:
only: /^v.*/
- semantic-release:
requires:
- test
filters:
branches:
only: master
- deploy:
requires:
- test
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/