.travis.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. language: go
  2. go:
  3. - 1.5.x
  4. - 1.6.x
  5. - 1.7.x
  6. - 1.8.x
  7. - 1.9.x
  8. - master
  9. sudo: true
  10. env:
  11. global:
  12. - PGUSER=postgres
  13. - PQGOSSLTESTS=1
  14. - PQSSLCERTTEST_PATH=$PWD/certs
  15. - PGHOST=127.0.0.1
  16. - MEGACHECK_VERSION=2017.2.1
  17. matrix:
  18. - PGVERSION=10
  19. - PGVERSION=9.6
  20. - PGVERSION=9.5
  21. - PGVERSION=9.4
  22. - PGVERSION=9.3
  23. - PGVERSION=9.2
  24. - PGVERSION=9.1
  25. - PGVERSION=9.0
  26. before_install:
  27. - ./.travis.sh postgresql_uninstall
  28. - ./.travis.sh pgdg_repository
  29. - ./.travis.sh postgresql_install
  30. - ./.travis.sh postgresql_configure
  31. - ./.travis.sh client_configure
  32. - ./.travis.sh megacheck_install
  33. - ./.travis.sh golint_install
  34. - go get golang.org/x/tools/cmd/goimports
  35. before_script:
  36. - createdb pqgotest
  37. - createuser -DRS pqgossltest
  38. - createuser -DRS pqgosslcert
  39. script:
  40. - >
  41. goimports -d -e $(find -name '*.go') | awk '{ print } END { exit NR == 0 ? 0 : 1 }'
  42. - go vet ./...
  43. # For compatibility with Go 1.5, launch only if megacheck is present.
  44. - >
  45. which megacheck > /dev/null && megacheck -go 1.5 ./...
  46. || echo 'megacheck is not supported, skipping check'
  47. # For compatibility with Go 1.5, launch only if golint is present.
  48. - >
  49. which golint > /dev/null && golint ./...
  50. || echo 'golint is not supported, skipping check'
  51. - PQTEST_BINARY_PARAMETERS=no go test -race -v ./...
  52. - PQTEST_BINARY_PARAMETERS=yes go test -race -v ./...