github.com/wangyougui/gf/v2@v2.6.5/.github/workflows/ci-sub.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  coverage=$1
     4  
     5  # find all path that contains go.mod.
     6  for file in `find . -name go.mod`; do
     7      dirpath=$(dirname $file)
     8      echo $dirpath
     9  
    10      # package kuhecm needs golang >= v1.19
    11      if [ "kubecm" = $(basename $dirpath) ]; then
    12          if ! go version|grep -qE "go1.19|go1.[2-9][0-9]"; then
    13            echo "ignore kubecm as go version: $(go version)"
    14            continue 1
    15          fi
    16      else
    17        continue 1
    18      fi
    19  
    20      cd $dirpath
    21  
    22      go mod tidy
    23      go build ./...
    24      go test ./... -race || exit 1
    25  
    26      cd -
    27  done