github.com/codingeasygo/util@v0.0.0-20231206062002-1ce2f004b7d9/build.sh (about)

     1  #!/bin/bash
     2  ##############################
     3  #####Setting Environments#####
     4  echo "Setting Environments"
     5  set -e
     6  export PATH=$PATH:$GOPATH/bin:$HOME/bin:$GOROOT/bin
     7  ##############################
     8  ######Install Dependence######
     9  echo "Installing Dependence"
    10  #########Running Clear#########
    11  #########Running Test#########
    12  echo "Running Test"
    13  pkgs="\
    14    github.com/codingeasygo/util/attrvalid\
    15    github.com/codingeasygo/util/converter\
    16    github.com/codingeasygo/util/monitor\
    17    github.com/codingeasygo/util/uuid\
    18    github.com/codingeasygo/util/xhttp\
    19    github.com/codingeasygo/util/xio\
    20    github.com/codingeasygo/util/xio/frame\
    21    github.com/codingeasygo/util/xmap\
    22    github.com/codingeasygo/util/xprop\
    23  "
    24  echo "mode: set" >a.out
    25  for p in $pkgs; do
    26    go build $p
    27    go test -v --coverprofile=c.out $p
    28    cat c.out | grep -v "mode" >>a.out
    29    go install $p
    30  done
    31  gocov convert a.out >coverage.json
    32  
    33  ##############################
    34  #####Create Coverage Report###
    35  echo "Create Coverage Report"
    36  cat coverage.json | gocov-xml -b $GOPATH/src >coverage.xml
    37  cat coverage.json | gocov-html coverage.json >coverage.html