Codebase list golang-github-go-kit-kit / 4219521 bin / coverage-circle.bash
4219521

Tree @4219521 (Download .tar.gz)

coverage-circle.bash @4219521raw · history · blame

#!/bin/bash

set -e

echo "mode: count" >| profile.cov

for dir in $(find . -maxdepth 10 -not -path './.git*' -not -path '*/_*' -type d);
do
if ls $dir/*.go &> /dev/null; then
    go test -covermode=count -coverprofile=$dir/profile.tmp $dir
    if [ -f $dir/profile.tmp ]
    then
        cat $dir/profile.tmp | tail -n +2 >> profile.cov
        rm $dir/profile.tmp
    fi
fi
done

go tool cover -func profile.cov

goveralls -coverprofile=profile.cov -service=circle-ci -repotoken=$COVERALLS_TOKEN