Try to fix Circle
Peter Bourgon
8 years ago
|
0 |
profile.cov
|
0 | 1 |
cover.out
|
1 | 2 |
examples/addsvc/addsvc
|
2 | 3 |
examples/addsvc/client/addcli/addcli
|
|
0 |
#!/bin/bash
|
|
1 |
|
|
2 |
set -e
|
|
3 |
|
|
4 |
echo "mode: count" >| profile.cov
|
|
5 |
|
|
6 |
for dir in $(find . -maxdepth 10 -not -path './.git*' -not -path '*/_*' -type d);
|
|
7 |
do
|
|
8 |
if ls $dir/*.go &> /dev/null; then
|
|
9 |
go test -covermode=count -coverprofile=$dir/profile.tmp $dir
|
|
10 |
if [ -f $dir/profile.tmp ]
|
|
11 |
then
|
|
12 |
cat $dir/profile.tmp | tail -n +2 >> profile.cov
|
|
13 |
rm $dir/profile.tmp
|
|
14 |
fi
|
|
15 |
fi
|
|
16 |
done
|
|
17 |
|
|
18 |
go tool cover -func profile.cov
|
|
19 |
|
|
20 |
goveralls -coverprofile=profile.cov -service=circle-ci -repotoken=$COVERALLS_TOKEN
|
|
21 |
|
3 | 3 |
- go get github.com/mattn/goveralls
|
4 | 4 |
- if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi
|
5 | 5 |
override:
|
6 | |
- go test -v -cover -race -coverprofile=/home/ubuntu/coverage.out
|
7 | |
post:
|
8 | |
- /home/ubuntu/bin/goveralls -coverprofile=/home/ubuntu/coverage.out -service=circle-ci -repotoken=$COVERALLS_TOKEN
|
|
6 |
- bin/coverage-circle.bash
|
9 | 7 |
|