wercker.yml 4.3 KB

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