Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

44 linhas
1.1 KiB

  1. #!/bin/bash
  2. # Fail on any error
  3. set -eo pipefail
  4. # Display commands being run
  5. set -x
  6. # cd to project dir on Kokoro instance
  7. cd github/go-genproto
  8. go version
  9. # Set $GOPATH
  10. export GOPATH="$HOME/go"
  11. export GENPROTO_HOME=$GOPATH/src/google.golang.org/genproto
  12. export PATH="$GOPATH/bin:$PATH"
  13. mkdir -p $GENPROTO_HOME
  14. # Move code into $GOPATH and get dependencies
  15. git clone . $GENPROTO_HOME
  16. cd $GENPROTO_HOME
  17. try3() { eval "$*" || eval "$*" || eval "$*"; }
  18. download_deps() {
  19. if [[ `go version` == *"go1.11"* ]] || [[ `go version` == *"go1.12"* ]]; then
  20. export GO111MODULE=on
  21. # All packages, including +build tools, are fetched.
  22. try3 go mod download
  23. else
  24. # Because we don't provide -tags tools, the +build tools
  25. # dependencies aren't fetched.
  26. try3 go get -v -t ./...
  27. fi
  28. }
  29. download_deps
  30. ./internal/kokoro/vet.sh
  31. ./internal/kokoro/check_incompat_changes.sh
  32. # Run tests and tee output to log file, to be pushed to GCS as artifact.
  33. go test -race -v ./... 2>&1 | tee $KOKORO_ARTIFACTS_DIR/$KOKORO_GERRIT_CHANGE_NUMBER.txt