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

.drone.yml 6.3 kB

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