.travis.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. sudo: false
  2. language: go
  3. go:
  4. - 1.5
  5. - 1.6
  6. - 1.7
  7. - 1.8
  8. - 1.9
  9. - tip
  10. before_install:
  11. - go get golang.org/x/tools/cmd/cover
  12. - go get github.com/mattn/goveralls
  13. before_script:
  14. - echo -e "[server]\ninnodb_log_file_size=256MB\ninnodb_buffer_pool_size=512MB\nmax_allowed_packet=16MB" | sudo tee -a /etc/mysql/my.cnf
  15. - sudo service mysql restart
  16. - .travis/wait_mysql.sh
  17. - mysql -e 'create database gotest;'
  18. matrix:
  19. include:
  20. - env: DB=MYSQL57
  21. sudo: required
  22. dist: trusty
  23. go: 1.9
  24. services:
  25. - docker
  26. before_install:
  27. - go get golang.org/x/tools/cmd/cover
  28. - go get github.com/mattn/goveralls
  29. - docker pull mysql:5.7
  30. - docker run -d -p 127.0.0.1:3307:3306 --name mysqld -e MYSQL_DATABASE=gotest -e MYSQL_USER=gotest -e MYSQL_PASSWORD=secret -e MYSQL_ROOT_PASSWORD=verysecret
  31. mysql:5.7 --innodb_log_file_size=256MB --innodb_buffer_pool_size=512MB --max_allowed_packet=16MB
  32. - sleep 30
  33. - cp .travis/docker.cnf ~/.my.cnf
  34. - mysql --print-defaults
  35. - .travis/wait_mysql.sh
  36. before_script:
  37. - export MYSQL_TEST_USER=gotest
  38. - export MYSQL_TEST_PASS=secret
  39. - export MYSQL_TEST_ADDR=127.0.0.1:3307
  40. - export MYSQL_TEST_CONCURRENT=1
  41. - env: DB=MARIA55
  42. sudo: required
  43. dist: trusty
  44. go: 1.9
  45. services:
  46. - docker
  47. before_install:
  48. - go get golang.org/x/tools/cmd/cover
  49. - go get github.com/mattn/goveralls
  50. - docker pull mariadb:5.5
  51. - docker run -d -p 127.0.0.1:3307:3306 --name mysqld -e MYSQL_DATABASE=gotest -e MYSQL_USER=gotest -e MYSQL_PASSWORD=secret -e MYSQL_ROOT_PASSWORD=verysecret
  52. mariadb:5.5 --innodb_log_file_size=256MB --innodb_buffer_pool_size=512MB --max_allowed_packet=16MB
  53. - sleep 30
  54. - cp .travis/docker.cnf ~/.my.cnf
  55. - mysql --print-defaults
  56. - .travis/wait_mysql.sh
  57. before_script:
  58. - export MYSQL_TEST_USER=gotest
  59. - export MYSQL_TEST_PASS=secret
  60. - export MYSQL_TEST_ADDR=127.0.0.1:3307
  61. - export MYSQL_TEST_CONCURRENT=1
  62. - env: DB=MARIA10_1
  63. sudo: required
  64. dist: trusty
  65. go: 1.9
  66. services:
  67. - docker
  68. before_install:
  69. - go get golang.org/x/tools/cmd/cover
  70. - go get github.com/mattn/goveralls
  71. - docker pull mariadb:10.1
  72. - docker run -d -p 127.0.0.1:3307:3306 --name mysqld -e MYSQL_DATABASE=gotest -e MYSQL_USER=gotest -e MYSQL_PASSWORD=secret -e MYSQL_ROOT_PASSWORD=verysecret
  73. mariadb:10.1 --innodb_log_file_size=256MB --innodb_buffer_pool_size=512MB --max_allowed_packet=16MB
  74. - sleep 30
  75. - cp .travis/docker.cnf ~/.my.cnf
  76. - mysql --print-defaults
  77. - .travis/wait_mysql.sh
  78. before_script:
  79. - export MYSQL_TEST_USER=gotest
  80. - export MYSQL_TEST_PASS=secret
  81. - export MYSQL_TEST_ADDR=127.0.0.1:3307
  82. - export MYSQL_TEST_CONCURRENT=1
  83. script:
  84. - go test -v -covermode=count -coverprofile=coverage.out
  85. - go vet ./...
  86. - test -z "$(gofmt -d -s . | tee /dev/stderr)"
  87. - $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci