.travis.yml 4.6 KB

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