github.com/IRelaxxx/servefiles/v3@v3.4.6/build+test (about)

     1  #!/bin/bash -e
     2  cd "$(dirname $0)"
     3  PATH=$HOME/go/bin:$PATH
     4  unset GOPATH
     5  export GO111MODULE=on
     6  
     7  function announce
     8  {
     9    echo
    10    echo $@
    11  }
    12  
    13  function v
    14  {
    15    announce $@
    16    $@
    17  }
    18  
    19  if ! type -p goveralls; then
    20    v go install github.com/mattn/goveralls
    21  fi
    22  
    23  if ! type -p goreturns; then
    24    v go install github.com/sqs/goreturns
    25  fi
    26  
    27  v go test -v ./...
    28  
    29  v go test -v -covermode=count -coverprofile=cover.out .
    30  go tool cover -func=cover.out
    31  [ -z "$COVERALLS_TOKEN" ] || goveralls -coverprofile=cover.out -service=travis-ci -repotoken $COVERALLS_TOKEN || echo 'Coult not push to coveralls'
    32  rm cover.out
    33  
    34  v goreturns -l -w *.go */*.go
    35  
    36  v go vet ./...