circle-test.sh 622 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. function exit_if_fail {
  3. command=$@
  4. echo "Executing '$command'"
  5. eval $command
  6. rc=$?
  7. if [ $rc -ne 0 ]; then
  8. echo "'$command' returned $rc."
  9. exit $rc
  10. fi
  11. }
  12. cd /home/ubuntu/.go_workspace/src/github.com/grafana/grafana
  13. rm -rf node_modules
  14. npm install -g yarn --quiet
  15. yarn install --pure-lockfile --no-progress
  16. exit_if_fail npm test
  17. echo "running go fmt"
  18. exit_if_fail test -z "$(gofmt -s -l ./pkg | tee /dev/stderr)"
  19. echo "running go vet"
  20. exit_if_fail test -z "$(go vet ./pkg/... | tee /dev/stderr)"
  21. exit_if_fail go run build.go build
  22. exit_if_fail go test -v ./pkg/...