From ee86afe21e156f537449528c92d142e809fbedea Mon Sep 17 00:00:00 2001 From: Wang Jing Date: Tue, 26 Sep 2017 11:57:10 +0800 Subject: [PATCH] add coverage result to codecov Change-Id: I5fca25e8d4e33da6eb412189022c2e871cb1801e --- .travis.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 589043894..864a8767f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,8 @@ go: - 1.7 - 1.8 - master + +go_import_path: github.com/gogits/gogs before_install: - sudo apt-get update -qq @@ -12,6 +14,20 @@ before_install: env: - GO15VENDOREXPERIMENT=1 -script: +script: - go build -v -tags "pam" - - go test -v -cover -race ./... + - |#!/usr/bin/env bash + + set -e + echo "" > coverage.txt + + for d in $(go list ./... | grep -v vendor); do + go test -race -coverprofile=profile.out -covermode=atomic $d + if [ -f profile.out ]; then + cat profile.out >> coverage.txt + rm profile.out + fi + done + +after_success: + - bash <(curl -s https://codecov.io/bash)