add travis-ci

This commit is contained in:
YDZ
2020-08-06 22:40:35 +08:00
parent ca60fc231d
commit ef3da5d363
2 changed files with 31 additions and 0 deletions

18
.travis.yml Normal file
View File

@ -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)

13
gotest.sh Normal file
View File

@ -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