diff --git a/.circleci/config.yml b/.circleci/config.yml index 02b0328..74e4a23 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,6 +3,7 @@ version: 2.1 orbs: prometheus: prometheus/prometheus@0.4.0 + codecov: codecov/codecov@1.0.5 executors: # Whenever the Go version is updated here, .promu.yml should @@ -17,6 +18,9 @@ jobs: steps: - prometheus/setup_environment - run: make + - run: make coverage + - codecov/upload: + file: coverage.txt - prometheus/store_artifact: file: cgroup_exporter build: diff --git a/.gitignore b/.gitignore index 1b765f3..a18f76b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /.tarballs /.build /cgroup_exporter +/coverage.txt diff --git a/Makefile b/Makefile index 7ce93b9..838d3d0 100644 --- a/Makefile +++ b/Makefile @@ -5,3 +5,6 @@ DOCKER_REPO ?= treydock include Makefile.common DOCKER_IMAGE_NAME ?= cgroup_exporter + +coverage: + go test -race -coverpkg=./... -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/README.md b/README.md index aa524d3..eab401c 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Build Status](https://circleci.com/gh/treydock/cgroup_exporter/tree/master.svg?style=shield)](https://circleci.com/gh/treydock/cgroup_exporter) [![GitHub release](https://img.shields.io/github/v/release/treydock/cgroup_exporter?include_prereleases&sort=semver)](https://github.com/treydock/cgroup_exporter/releases/latest) ![GitHub All Releases](https://img.shields.io/github/downloads/treydock/cgroup_exporter/total) +[![codecov](https://codecov.io/gh/treydock/cgroup_exporter/branch/master/graph/badge.svg)](https://codecov.io/gh/treydock/cgroup_exporter) # Check mount Prometheus exporter