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.

304 lines
6.0 KiB

  1. ---
  2. kind: pipeline
  3. name: testing
  4. steps:
  5. - name: test-vet
  6. image: golang:1.11 # The lowest golang requirement
  7. environment:
  8. GO111MODULE: "on"
  9. GOPROXY: "https://goproxy.cn"
  10. commands:
  11. - make vet
  12. - make test
  13. when:
  14. event:
  15. - push
  16. - pull_request
  17. - name: test-sqlite
  18. image: golang:1.12
  19. environment:
  20. GO111MODULE: "on"
  21. GOPROXY: "https://goproxy.cn"
  22. commands:
  23. - make test-sqlite
  24. - TEST_CACHE_ENABLE=true make test-sqlite
  25. - TEST_QUOTE_POLICY=reserved make test-sqlite
  26. when:
  27. event:
  28. - push
  29. - pull_request
  30. - name: test-mysql
  31. image: golang:1.12
  32. environment:
  33. GO111MODULE: "on"
  34. GOPROXY: "https://goproxy.cn"
  35. TEST_MYSQL_HOST: mysql
  36. TEST_MYSQL_CHARSET: utf8
  37. TEST_MYSQL_DBNAME: xorm_test
  38. TEST_MYSQL_USERNAME: root
  39. TEST_MYSQL_PASSWORD:
  40. commands:
  41. - make test-mysql
  42. - TEST_CACHE_ENABLE=true make test-mysql
  43. - TEST_QUOTE_POLICY=reserved make test-mysql
  44. when:
  45. event:
  46. - push
  47. - pull_request
  48. - name: test-mysql8
  49. image: golang:1.12
  50. environment:
  51. GO111MODULE: "on"
  52. GOPROXY: "https://goproxy.cn"
  53. TEST_MYSQL_HOST: mysql8
  54. TEST_MYSQL_CHARSET: utf8mb4
  55. TEST_MYSQL_DBNAME: xorm_test
  56. TEST_MYSQL_USERNAME: root
  57. TEST_MYSQL_PASSWORD:
  58. commands:
  59. - make test-mysql
  60. - TEST_CACHE_ENABLE=true make test-mysql
  61. - TEST_QUOTE_POLICY=reserved make test-mysql
  62. when:
  63. event:
  64. - push
  65. - pull_request
  66. - name: test-mysql-utf8mb4
  67. image: golang:1.12
  68. depends_on:
  69. - test-mysql
  70. environment:
  71. GO111MODULE: "on"
  72. GOPROXY: "https://goproxy.cn"
  73. TEST_MYSQL_HOST: mysql
  74. TEST_MYSQL_CHARSET: utf8mb4
  75. TEST_MYSQL_DBNAME: xorm_test
  76. TEST_MYSQL_USERNAME: root
  77. TEST_MYSQL_PASSWORD:
  78. commands:
  79. - make test-mysql
  80. - TEST_CACHE_ENABLE=true make test-mysql
  81. - TEST_QUOTE_POLICY=reserved make test-mysql
  82. when:
  83. event:
  84. - push
  85. - pull_request
  86. - name: test-mymysql
  87. pull: default
  88. image: golang:1.12
  89. depends_on:
  90. - test-mysql-utf8mb4
  91. environment:
  92. GO111MODULE: "on"
  93. GOPROXY: "https://goproxy.cn"
  94. TEST_MYSQL_HOST: mysql:3306
  95. TEST_MYSQL_DBNAME: xorm_test
  96. TEST_MYSQL_USERNAME: root
  97. TEST_MYSQL_PASSWORD:
  98. commands:
  99. - make test-mymysql
  100. - TEST_CACHE_ENABLE=true make test-mymysql
  101. - TEST_QUOTE_POLICY=reserved make test-mymysql
  102. when:
  103. event:
  104. - push
  105. - pull_request
  106. - name: test-postgres
  107. pull: default
  108. image: golang:1.12
  109. environment:
  110. GO111MODULE: "on"
  111. GOPROXY: "https://goproxy.cn"
  112. TEST_PGSQL_HOST: pgsql
  113. TEST_PGSQL_DBNAME: xorm_test
  114. TEST_PGSQL_USERNAME: postgres
  115. TEST_PGSQL_PASSWORD: postgres
  116. commands:
  117. - make test-postgres
  118. - TEST_CACHE_ENABLE=true make test-postgres
  119. - TEST_QUOTE_POLICY=reserved make test-postgres
  120. when:
  121. event:
  122. - push
  123. - pull_request
  124. - name: test-postgres-schema
  125. pull: default
  126. image: golang:1.12
  127. depends_on:
  128. - test-postgres
  129. environment:
  130. GO111MODULE: "on"
  131. GOPROXY: "https://goproxy.cn"
  132. TEST_PGSQL_HOST: pgsql
  133. TEST_PGSQL_SCHEMA: xorm
  134. TEST_PGSQL_DBNAME: xorm_test
  135. TEST_PGSQL_USERNAME: postgres
  136. TEST_PGSQL_PASSWORD: postgres
  137. commands:
  138. - make test-postgres
  139. - TEST_CACHE_ENABLE=true make test-postgres
  140. - TEST_QUOTE_POLICY=reserved make test-postgres
  141. when:
  142. event:
  143. - push
  144. - pull_request
  145. - name: test-mssql
  146. pull: default
  147. image: golang:1.12
  148. environment:
  149. GO111MODULE: "on"
  150. GOPROXY: "https://goproxy.cn"
  151. TEST_MSSQL_HOST: mssql
  152. TEST_MSSQL_DBNAME: xorm_test
  153. TEST_MSSQL_USERNAME: sa
  154. TEST_MSSQL_PASSWORD: "yourStrong(!)Password"
  155. commands:
  156. - make test-mssql
  157. - TEST_CACHE_ENABLE=true make test-mssql
  158. - TEST_QUOTE_POLICY=reserved make test-mssql
  159. when:
  160. event:
  161. - push
  162. - pull_request
  163. - name: test-tidb
  164. pull: default
  165. image: golang:1.12
  166. environment:
  167. GO111MODULE: "on"
  168. GOPROXY: "https://goproxy.cn"
  169. TEST_TIDB_HOST: "tidb:4000"
  170. TEST_TIDB_DBNAME: xorm_test
  171. TEST_TIDB_USERNAME: root
  172. TEST_TIDB_PASSWORD:
  173. commands:
  174. - make test-tidb
  175. - TEST_CACHE_ENABLE=true make test-tidb
  176. - TEST_QUOTE_POLICY=reserved make test-tidb
  177. when:
  178. event:
  179. - push
  180. - pull_request
  181. - name: test-cockroach
  182. pull: default
  183. image: golang:1.13
  184. environment:
  185. GO111MODULE: "on"
  186. GOPROXY: "https://goproxy.cn"
  187. TEST_COCKROACH_HOST: "cockroach:26257"
  188. TEST_COCKROACH_DBNAME: xorm_test
  189. TEST_COCKROACH_USERNAME: root
  190. TEST_COCKROACH_PASSWORD:
  191. commands:
  192. - sleep 10
  193. - make test-cockroach
  194. - TEST_CACHE_ENABLE=true make test-cockroach
  195. when:
  196. event:
  197. - push
  198. - pull_request
  199. - name: merge_coverage
  200. pull: default
  201. image: golang:1.12
  202. environment:
  203. GO111MODULE: "on"
  204. GOPROXY: "https://goproxy.cn"
  205. depends_on:
  206. - test-vet
  207. - test-sqlite
  208. - test-mysql
  209. - test-mysql8
  210. - test-mymysql
  211. - test-postgres
  212. - test-postgres-schema
  213. - test-mssql
  214. - test-tidb
  215. - test-cockroach
  216. commands:
  217. - make coverage
  218. when:
  219. event:
  220. - push
  221. - pull_request
  222. services:
  223. - name: mysql
  224. pull: default
  225. image: mysql:5.7
  226. environment:
  227. MYSQL_ALLOW_EMPTY_PASSWORD: yes
  228. MYSQL_DATABASE: xorm_test
  229. when:
  230. event:
  231. - push
  232. - tag
  233. - pull_request
  234. - name: mysql8
  235. pull: default
  236. image: mysql:8.0
  237. environment:
  238. MYSQL_ALLOW_EMPTY_PASSWORD: yes
  239. MYSQL_DATABASE: xorm_test
  240. when:
  241. event:
  242. - push
  243. - tag
  244. - pull_request
  245. - name: pgsql
  246. pull: default
  247. image: postgres:9.5
  248. environment:
  249. POSTGRES_DB: xorm_test
  250. POSTGRES_USER: postgres
  251. POSTGRES_PASSWORD: postgres
  252. when:
  253. event:
  254. - push
  255. - tag
  256. - pull_request
  257. - name: mssql
  258. pull: default
  259. image: microsoft/mssql-server-linux:latest
  260. environment:
  261. ACCEPT_EULA: Y
  262. SA_PASSWORD: yourStrong(!)Password
  263. MSSQL_PID: Developer
  264. when:
  265. event:
  266. - push
  267. - tag
  268. - pull_request
  269. - name: tidb
  270. pull: default
  271. image: pingcap/tidb:v3.0.3
  272. when:
  273. event:
  274. - push
  275. - tag
  276. - pull_request
  277. - name: cockroach
  278. pull: default
  279. image: cockroachdb/cockroach:v19.2.4
  280. commands:
  281. - /cockroach/cockroach start --insecure
  282. when:
  283. event:
  284. - push
  285. - tag
  286. - pull_request