b95fe70b9c
* ci: Use docker multi-stage builds * refactor: Migrate from dep to go mod * ci: Add Makefile to simplify builds * ci: Upgrade to golang 1.11 * refactor: Run goimports for formatting
64 lines
1.7 KiB
YAML
64 lines
1.7 KiB
YAML
version: 2
|
|
jobs:
|
|
|
|
test:
|
|
docker:
|
|
- image: circleci/golang:1.11
|
|
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:9
|
|
steps:
|
|
- checkout
|
|
- run: yarn global add --prefer-offline --no-progress --non-interactive "semantic-release@15.5.0" "@semantic-release/exec@2.2.4"
|
|
- run: $(yarn global bin)/semantic-release
|
|
|
|
deploy:
|
|
docker:
|
|
- image: circleci/golang:1.10
|
|
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.*/
|