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 6.7KB

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