.travis.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. sudo: false
  2. language: go
  3. go:
  4. - 1.8.x
  5. - 1.9.x
  6. - 1.10.x
  7. - master
  8. before_install:
  9. - go get golang.org/x/tools/cmd/cover
  10. - go get github.com/mattn/goveralls
  11. before_script:
  12. - echo -e "[server]\ninnodb_log_file_size=256MB\ninnodb_buffer_pool_size=512MB\nmax_allowed_packet=16MB" | sudo tee -a /etc/mysql/my.cnf
  13. - sudo service mysql restart
  14. - .travis/wait_mysql.sh
  15. - mysql -e 'create database gotest;'
  16. matrix:
  17. include:
  18. - env: DB=MYSQL8
  19. sudo: required
  20. dist: trusty
  21. go: 1.10.x
  22. services:
  23. - docker
  24. before_install:
  25. - go get golang.org/x/tools/cmd/cover
  26. - go get github.com/mattn/goveralls
  27. - docker pull mysql:8.0
  28. - 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
  29. mysql:8.0 --innodb_log_file_size=256MB --innodb_buffer_pool_size=512MB --max_allowed_packet=16MB --local-infile=1
  30. - cp .travis/docker.cnf ~/.my.cnf
  31. - .travis/wait_mysql.sh
  32. before_script:
  33. - export MYSQL_TEST_USER=gotest
  34. - export MYSQL_TEST_PASS=secret
  35. - export MYSQL_TEST_ADDR=127.0.0.1:3307
  36. - export MYSQL_TEST_CONCURRENT=1
  37. - env: DB=MYSQL57
  38. sudo: required
  39. dist: trusty
  40. go: 1.10.x
  41. services:
  42. - docker
  43. before_install:
  44. - go get golang.org/x/tools/cmd/cover
  45. - go get github.com/mattn/goveralls
  46. - docker pull mysql:5.7
  47. - 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
  48. mysql:5.7 --innodb_log_file_size=256MB --innodb_buffer_pool_size=512MB --max_allowed_packet=16MB --local-infile=1
  49. - cp .travis/docker.cnf ~/.my.cnf
  50. - .travis/wait_mysql.sh
  51. before_script:
  52. - export MYSQL_TEST_USER=gotest
  53. - export MYSQL_TEST_PASS=secret
  54. - export MYSQL_TEST_ADDR=127.0.0.1:3307
  55. - export MYSQL_TEST_CONCURRENT=1
  56. - env: DB=MARIA55
  57. sudo: required
  58. dist: trusty
  59. go: 1.10.x
  60. services:
  61. - docker
  62. before_install:
  63. - go get golang.org/x/tools/cmd/cover
  64. - go get github.com/mattn/goveralls
  65. - docker pull mariadb:5.5
  66. - 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
  67. mariadb:5.5 --innodb_log_file_size=256MB --innodb_buffer_pool_size=512MB --max_allowed_packet=16MB --local-infile=1
  68. - cp .travis/docker.cnf ~/.my.cnf
  69. - .travis/wait_mysql.sh
  70. before_script:
  71. - export MYSQL_TEST_USER=gotest
  72. - export MYSQL_TEST_PASS=secret
  73. - export MYSQL_TEST_ADDR=127.0.0.1:3307
  74. - export MYSQL_TEST_CONCURRENT=1
  75. - env: DB=MARIA10_1
  76. sudo: required
  77. dist: trusty
  78. go: 1.10.x
  79. services:
  80. - docker
  81. before_install:
  82. - go get golang.org/x/tools/cmd/cover
  83. - go get github.com/mattn/goveralls
  84. - docker pull mariadb:10.1
  85. - 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
  86. mariadb:10.1 --innodb_log_file_size=256MB --innodb_buffer_pool_size=512MB --max_allowed_packet=16MB --local-infile=1
  87. - cp .travis/docker.cnf ~/.my.cnf
  88. - .travis/wait_mysql.sh
  89. before_script:
  90. - export MYSQL_TEST_USER=gotest
  91. - export MYSQL_TEST_PASS=secret
  92. - export MYSQL_TEST_ADDR=127.0.0.1:3307
  93. - export MYSQL_TEST_CONCURRENT=1
  94. script:
  95. - go test -v -covermode=count -coverprofile=coverage.out
  96. - go vet ./...
  97. - .travis/gofmt.sh
  98. after_script:
  99. - $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci