wercker.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # use the default golang container from Docker Hub
  2. box: golang
  3. services:
  4. - id: mariadb:10.0
  5. env:
  6. MYSQL_DATABASE: gorm
  7. MYSQL_USER: gorm
  8. MYSQL_PASSWORD: gorm
  9. MYSQL_RANDOM_ROOT_PASSWORD: "yes"
  10. - id: postgres
  11. env:
  12. POSTGRES_USER: gorm
  13. POSTGRES_PASSWORD: gorm
  14. POSTGRES_DB: gorm
  15. # The steps that will be executed in the build pipeline
  16. build:
  17. # The steps that will be executed on build
  18. steps:
  19. # Sets the go workspace and places you package
  20. # at the right place in the workspace tree
  21. - setup-go-workspace
  22. # Gets the dependencies
  23. - script:
  24. name: go get
  25. code: |
  26. cd $WERCKER_SOURCE_DIR
  27. go version
  28. go get -t ./...
  29. # Build the project
  30. - script:
  31. name: go build
  32. code: |
  33. go build ./...
  34. # Test the project
  35. - script:
  36. name: test sqlite
  37. code: |
  38. go test ./...
  39. - script:
  40. name: test mysql
  41. code: |
  42. GORM_DIALECT=mysql GORM_DBADDRESS=mariadb:3306 go test ./...
  43. - script:
  44. name: test postgres
  45. code: |
  46. GORM_DIALECT=postgres GORM_DBHOST=postgres go test ./...