From ef3da5d363909c05150b9f0099cbabfa611ab9d0 Mon Sep 17 00:00:00 2001 From: YDZ Date: Thu, 6 Aug 2020 22:40:35 +0800 Subject: [PATCH] add travis-ci --- .travis.yml | 18 ++++++++++++++++++ gotest.sh | 13 +++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 .travis.yml create mode 100644 gotest.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..8ea1ce31 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,18 @@ +language: go + +go: + - master + +# whitelist +branches: + only: + - master + - stable + +script: + - go get -t -v ./... + - go vet ./... + - bash ./gotest.sh + +after_success: + - bash <(curl -s https://codecov.io/bash) diff --git a/gotest.sh b/gotest.sh new file mode 100644 index 00000000..c9cbb90c --- /dev/null +++ b/gotest.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -e +echo "" > coverage.txt + +for d in $(go list ./Algorithms/... | grep -v vendor); do + echo $d + go test -coverprofile=profile.out -covermode=atomic $d + if [ -f profile.out ]; then + cat profile.out >> coverage.txt + rm profile.out + fi +done