wercker.yml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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:latest
  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: postgres
  33. id: postgres:latest
  34. env:
  35. POSTGRES_USER: gorm
  36. POSTGRES_PASSWORD: gorm
  37. POSTGRES_DB: gorm
  38. - name: postgres96
  39. id: postgres:9.6
  40. env:
  41. POSTGRES_USER: gorm
  42. POSTGRES_PASSWORD: gorm
  43. POSTGRES_DB: gorm
  44. - name: postgres95
  45. id: postgres:9.5
  46. env:
  47. POSTGRES_USER: gorm
  48. POSTGRES_PASSWORD: gorm
  49. POSTGRES_DB: gorm
  50. - name: postgres94
  51. id: postgres:9.4
  52. env:
  53. POSTGRES_USER: gorm
  54. POSTGRES_PASSWORD: gorm
  55. POSTGRES_DB: gorm
  56. - name: postgres93
  57. id: postgres:9.3
  58. env:
  59. POSTGRES_USER: gorm
  60. POSTGRES_PASSWORD: gorm
  61. POSTGRES_DB: gorm
  62. - name: mssql
  63. id: mcmoe/mssqldocker:latest
  64. env:
  65. ACCEPT_EULA: Y
  66. SA_PASSWORD: LoremIpsum86
  67. MSSQL_DB: gorm
  68. MSSQL_USER: gorm
  69. MSSQL_PASSWORD: LoremIpsum86
  70. # The steps that will be executed in the build pipeline
  71. build:
  72. # The steps that will be executed on build
  73. steps:
  74. # Sets the go workspace and places you package
  75. # at the right place in the workspace tree
  76. - setup-go-workspace
  77. # Gets the dependencies
  78. - script:
  79. name: go get
  80. code: |
  81. cd $WERCKER_SOURCE_DIR
  82. go version
  83. go get -t -v ./...
  84. # Build the project
  85. - script:
  86. name: go build
  87. code: |
  88. go build ./...
  89. # Test the project
  90. - script:
  91. name: test sqlite
  92. code: |
  93. go test -race -v ./...
  94. - script:
  95. name: test mariadb
  96. code: |
  97. GORM_DIALECT=mysql GORM_DSN="gorm:gorm@tcp(mariadb:3306)/gorm?charset=utf8&parseTime=True" go test -race ./...
  98. - script:
  99. name: test mysql
  100. code: |
  101. GORM_DIALECT=mysql GORM_DSN="gorm:gorm@tcp(mysql:3306)/gorm?charset=utf8&parseTime=True" go test -race ./...
  102. - script:
  103. name: test mysql5.7
  104. code: |
  105. GORM_DIALECT=mysql GORM_DSN="gorm:gorm@tcp(mysql57:3306)/gorm?charset=utf8&parseTime=True" go test -race ./...
  106. - script:
  107. name: test mysql5.6
  108. code: |
  109. GORM_DIALECT=mysql GORM_DSN="gorm:gorm@tcp(mysql56:3306)/gorm?charset=utf8&parseTime=True" go test -race ./...
  110. - script:
  111. name: test postgres
  112. code: |
  113. GORM_DIALECT=postgres GORM_DSN="host=postgres user=gorm password=gorm DB.name=gorm port=5432 sslmode=disable" go test -race ./...
  114. - script:
  115. name: test postgres96
  116. code: |
  117. GORM_DIALECT=postgres GORM_DSN="host=postgres96 user=gorm password=gorm DB.name=gorm port=5432 sslmode=disable" go test -race ./...
  118. - script:
  119. name: test postgres95
  120. code: |
  121. GORM_DIALECT=postgres GORM_DSN="host=postgres95 user=gorm password=gorm DB.name=gorm port=5432 sslmode=disable" go test -race ./...
  122. - script:
  123. name: test postgres94
  124. code: |
  125. GORM_DIALECT=postgres GORM_DSN="host=postgres94 user=gorm password=gorm DB.name=gorm port=5432 sslmode=disable" go test -race ./...
  126. - script:
  127. name: test postgres93
  128. code: |
  129. GORM_DIALECT=postgres GORM_DSN="host=postgres93 user=gorm password=gorm DB.name=gorm port=5432 sslmode=disable" go test -race ./...
  130. - script:
  131. name: test mssql
  132. code: |
  133. GORM_DIALECT=mssql GORM_DSN="sqlserver://gorm:LoremIpsum86@mssql:1433?database=gorm" go test -race ./...
  134. - script:
  135. name: codecov
  136. code: |
  137. go test -race -coverprofile=coverage.txt -covermode=atomic ./...
  138. bash <(curl -s https://codecov.io/bash)