You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

.drone.yml 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. ---
  2. kind: pipeline
  3. name: testing
  4. steps:
  5. - name: test-vet
  6. pull: default
  7. image: golang:1.12
  8. environment:
  9. GO111MODULE: "on"
  10. GOPROXY: "https://goproxy.cn"
  11. commands:
  12. - go vet
  13. when:
  14. event:
  15. - push
  16. - pull_request
  17. - name: test-sqlite
  18. pull: default
  19. image: golang:1.12
  20. environment:
  21. GO111MODULE: "on"
  22. GOPROXY: "https://goproxy.cn"
  23. commands:
  24. - "go test -v -race -db=\"sqlite3\" -conn_str=\"./test.db\" -coverprofile=coverage1-1.txt -covermode=atomic"
  25. - "go test -v -race -db=\"sqlite3\" -conn_str=\"./test.db\" -cache=true -coverprofile=coverage1-2.txt -covermode=atomic"
  26. when:
  27. event:
  28. - push
  29. - pull_request
  30. - name: test-mysql
  31. pull: default
  32. image: golang:1.12
  33. environment:
  34. GO111MODULE: "on"
  35. GOPROXY: "https://goproxy.cn"
  36. commands:
  37. - "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(mysql)/xorm_test\" -coverprofile=coverage2-1.txt -covermode=atomic"
  38. - "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(mysql)/xorm_test\" -cache=true -coverprofile=coverage2-2.txt -covermode=atomic"
  39. when:
  40. event:
  41. - push
  42. - pull_request
  43. - name: test-mysql-utf8mb4
  44. pull: default
  45. image: golang:1.12
  46. depends_on:
  47. - test-mysql
  48. environment:
  49. GO111MODULE: "on"
  50. GOPROXY: "https://goproxy.cn"
  51. commands:
  52. - "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(mysql)/xorm_test?charset=utf8mb4\" -coverprofile=coverage2.1-1.txt -covermode=atomic"
  53. - "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(mysql)/xorm_test?charset=utf8mb4\" -cache=true -coverprofile=coverage2.1-2.txt -covermode=atomic"
  54. when:
  55. event:
  56. - push
  57. - pull_request
  58. - name: test-mymysql
  59. pull: default
  60. image: golang:1.12
  61. depends_on:
  62. - test-mysql-utf8mb4
  63. environment:
  64. GO111MODULE: "on"
  65. GOPROXY: "https://goproxy.cn"
  66. commands:
  67. - "go test -v -race -db=\"mymysql\" -conn_str=\"tcp:mysql:3306*xorm_test/root/\" -coverprofile=coverage3-1.txt -covermode=atomic"
  68. - "go test -v -race -db=\"mymysql\" -conn_str=\"tcp:mysql:3306*xorm_test/root/\" -cache=true -coverprofile=coverage3-2.txt -covermode=atomic"
  69. when:
  70. event:
  71. - push
  72. - pull_request
  73. - name: test-postgres
  74. pull: default
  75. image: golang:1.12
  76. environment:
  77. GO111MODULE: "on"
  78. GOPROXY: "https://goproxy.cn"
  79. commands:
  80. - "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:@pgsql/xorm_test?sslmode=disable\" -coverprofile=coverage4-1.txt -covermode=atomic"
  81. - "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:@pgsql/xorm_test?sslmode=disable\" -cache=true -coverprofile=coverage4-2.txt -covermode=atomic"
  82. when:
  83. event:
  84. - push
  85. - pull_request
  86. - name: test-postgres-schema
  87. pull: default
  88. image: golang:1.12
  89. environment:
  90. GO111MODULE: "on"
  91. GOPROXY: "https://goproxy.cn"
  92. commands:
  93. - "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:@pgsql/xorm_test?sslmode=disable\" -schema=xorm -coverprofile=coverage5-1.txt -covermode=atomic"
  94. - "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:@pgsql/xorm_test?sslmode=disable\" -schema=xorm -cache=true -coverprofile=coverage5-2.txt -covermode=atomic"
  95. when:
  96. event:
  97. - push
  98. - pull_request
  99. - name: test-mssql
  100. pull: default
  101. image: golang:1.12
  102. environment:
  103. GO111MODULE: "on"
  104. GOPROXY: "https://goproxy.cn"
  105. commands:
  106. - "go test -v -race -db=\"mssql\" -conn_str=\"server=mssql;user id=sa;password=yourStrong(!)Password;database=xorm_test\" -coverprofile=coverage6-1.txt -covermode=atomic"
  107. - "go test -v -race -db=\"mssql\" -conn_str=\"server=mssql;user id=sa;password=yourStrong(!)Password;database=xorm_test\" -cache=true -coverprofile=coverage6-2.txt -covermode=atomic"
  108. when:
  109. event:
  110. - push
  111. - pull_request
  112. - name: test-tidb
  113. pull: default
  114. image: golang:1.12
  115. environment:
  116. GO111MODULE: "on"
  117. GOPROXY: "https://goproxy.cn"
  118. commands:
  119. - "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(tidb:4000)/xorm_test\" -ignore_select_update=true -coverprofile=coverage7-1.txt -covermode=atomic"
  120. - "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(tidb:4000)/xorm_test\" -ignore_select_update=true -cache=true -coverprofile=coverage7-2.txt -covermode=atomic"
  121. when:
  122. event:
  123. - push
  124. - pull_request
  125. - name: merge_coverage
  126. pull: default
  127. image: golang:1.12
  128. environment:
  129. GO111MODULE: "on"
  130. GOPROXY: "https://goproxy.cn"
  131. depends_on:
  132. - test-vet
  133. - test-sqlite
  134. - test-mysql
  135. - test-mysql-utf8mb4
  136. - test-mymysql
  137. - test-postgres
  138. - test-postgres-schema
  139. - test-mssql
  140. - test-tidb
  141. commands:
  142. - go get github.com/wadey/gocovmerge
  143. - gocovmerge coverage1-1.txt coverage1-2.txt coverage2-1.txt coverage2-2.txt coverage2.1-1.txt coverage2.1-2.txt coverage3-1.txt coverage3-2.txt coverage4-1.txt coverage4-2.txt coverage5-1.txt coverage5-2.txt coverage6-1.txt coverage6-2.txt coverage7-1.txt coverage7-2.txt > coverage.txt
  144. when:
  145. event:
  146. - push
  147. - pull_request
  148. services:
  149. - name: mysql
  150. pull: default
  151. image: mysql:5.7
  152. environment:
  153. MYSQL_ALLOW_EMPTY_PASSWORD: yes
  154. MYSQL_DATABASE: xorm_test
  155. when:
  156. event:
  157. - push
  158. - tag
  159. - pull_request
  160. - name: pgsql
  161. pull: default
  162. image: postgres:9.5
  163. environment:
  164. POSTGRES_DB: xorm_test
  165. POSTGRES_USER: postgres
  166. when:
  167. event:
  168. - push
  169. - tag
  170. - pull_request
  171. - name: mssql
  172. pull: default
  173. image: microsoft/mssql-server-linux:latest
  174. environment:
  175. ACCEPT_EULA: Y
  176. SA_PASSWORD: yourStrong(!)Password
  177. MSSQL_PID: Developer
  178. when:
  179. event:
  180. - push
  181. - tag
  182. - pull_request
  183. - name: tidb
  184. pull: default
  185. image: pingcap/tidb:v3.0.3
  186. when:
  187. event:
  188. - push
  189. - tag
  190. - pull_request