wercker.yml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. # use the default golang container from Docker Hub
  2. box: golang
  3. services:
  4. - name: mariadb
  5. id: mariadb:latest
  6. env:
  7. MYSQL_DATABASE: gorm
  8. MYSQL_USER: gorm
  9. MYSQL_PASSWORD: gorm
  10. MYSQL_RANDOM_ROOT_PASSWORD: "yes"
  11. - name: mysql
  12. id: mysql:8
  13. env:
  14. MYSQL_DATABASE: gorm
  15. MYSQL_USER: gorm
  16. MYSQL_PASSWORD: gorm
  17. MYSQL_RANDOM_ROOT_PASSWORD: "yes"
  18. - name: mysql57
  19. id: mysql:5.7
  20. env:
  21. MYSQL_DATABASE: gorm
  22. MYSQL_USER: gorm
  23. MYSQL_PASSWORD: gorm
  24. MYSQL_RANDOM_ROOT_PASSWORD: "yes"
  25. - name: mysql56
  26. id: mysql:5.6
  27. env:
  28. MYSQL_DATABASE: gorm
  29. MYSQL_USER: gorm
  30. MYSQL_PASSWORD: gorm
  31. MYSQL_RANDOM_ROOT_PASSWORD: "yes"
  32. - name: mysql55
  33. id: mysql:5.5
  34. env:
  35. MYSQL_DATABASE: gorm
  36. MYSQL_USER: gorm
  37. MYSQL_PASSWORD: gorm
  38. MYSQL_RANDOM_ROOT_PASSWORD: "yes"
  39. - name: postgres
  40. id: postgres:latest
  41. env:
  42. POSTGRES_USER: gorm
  43. POSTGRES_PASSWORD: gorm
  44. POSTGRES_DB: gorm
  45. - name: postgres96
  46. id: postgres:9.6
  47. env:
  48. POSTGRES_USER: gorm
  49. POSTGRES_PASSWORD: gorm
  50. POSTGRES_DB: gorm
  51. - name: postgres95
  52. id: postgres:9.5
  53. env:
  54. POSTGRES_USER: gorm
  55. POSTGRES_PASSWORD: gorm
  56. POSTGRES_DB: gorm
  57. - name: postgres94
  58. id: postgres:9.4
  59. env:
  60. POSTGRES_USER: gorm
  61. POSTGRES_PASSWORD: gorm
  62. POSTGRES_DB: gorm
  63. - name: postgres93
  64. id: postgres:9.3
  65. env:
  66. POSTGRES_USER: gorm
  67. POSTGRES_PASSWORD: gorm
  68. POSTGRES_DB: gorm
  69. - name: mssql
  70. id: mcmoe/mssqldocker:latest
  71. env:
  72. ACCEPT_EULA: Y
  73. SA_PASSWORD: LoremIpsum86
  74. MSSQL_DB: gorm
  75. MSSQL_USER: gorm
  76. MSSQL_PASSWORD: LoremIpsum86
  77. # The steps that will be executed in the build pipeline
  78. build:
  79. # The steps that will be executed on build
  80. steps:
  81. # Sets the go workspace and places you package
  82. # at the right place in the workspace tree
  83. - setup-go-workspace
  84. # Gets the dependencies
  85. - script:
  86. name: go get
  87. code: |
  88. cd $WERCKER_SOURCE_DIR
  89. go version
  90. go get -t ./...
  91. # Build the project
  92. - script:
  93. name: go build
  94. code: |
  95. go build ./...
  96. # Test the project
  97. - script:
  98. name: test sqlite
  99. code: |
  100. go test ./...
  101. - script:
  102. name: test mariadb
  103. code: |
  104. GORM_DIALECT=mysql GORM_DSN="gorm:gorm@tcp(mariadb:3306)/gorm?charset=utf8&parseTime=True" go test ./...
  105. - script:
  106. name: test mysql
  107. code: |
  108. GORM_DIALECT=mysql GORM_DSN="gorm:gorm@tcp(mysql:3306)/gorm?charset=utf8&parseTime=True" go test ./...
  109. - script:
  110. name: test mysql5.7
  111. code: |
  112. GORM_DIALECT=mysql GORM_DSN="gorm:gorm@tcp(mysql57:3306)/gorm?charset=utf8&parseTime=True" go test ./...
  113. - script:
  114. name: test mysql5.6
  115. code: |
  116. GORM_DIALECT=mysql GORM_DSN="gorm:gorm@tcp(mysql56:3306)/gorm?charset=utf8&parseTime=True" go test ./...
  117. - script:
  118. name: test mysql5.5
  119. code: |
  120. GORM_DIALECT=mysql GORM_DSN="gorm:gorm@tcp(mysql55:3306)/gorm?charset=utf8&parseTime=True" go test ./...
  121. - script:
  122. name: test postgres
  123. code: |
  124. GORM_DIALECT=postgres GORM_DSN="host=postgres user=gorm password=gorm DB.name=gorm port=5432 sslmode=disable" go test ./...
  125. - script:
  126. name: test postgres96
  127. code: |
  128. GORM_DIALECT=postgres GORM_DSN="host=postgres96 user=gorm password=gorm DB.name=gorm port=5432 sslmode=disable" go test ./...
  129. - script:
  130. name: test postgres95
  131. code: |
  132. GORM_DIALECT=postgres GORM_DSN="host=postgres95 user=gorm password=gorm DB.name=gorm port=5432 sslmode=disable" go test ./...
  133. - script:
  134. name: test postgres94
  135. code: |
  136. GORM_DIALECT=postgres GORM_DSN="host=postgres94 user=gorm password=gorm DB.name=gorm port=5432 sslmode=disable" go test ./...
  137. - script:
  138. name: test postgres93
  139. code: |
  140. GORM_DIALECT=postgres GORM_DSN="host=postgres93 user=gorm password=gorm DB.name=gorm port=5432 sslmode=disable" go test ./...
  141. - script:
  142. name: test mssql
  143. code: |
  144. GORM_DIALECT=mssql GORM_DSN="sqlserver://gorm:LoremIpsum86@mssql:1433?database=gorm" go test ./...