Simple and Powerful ORM for Go, support mysql,postgres,tidb,sqlite3,mssql,oracle https://xorm.io
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.

394 lines
10KB

  1. ---
  2. kind: pipeline
  3. name: go1.10-test
  4. workspace:
  5. base: /go
  6. path: src/gitea.com/xorm/xorm
  7. steps:
  8. - name: build
  9. pull: default
  10. image: golang:1.10
  11. commands:
  12. - go get -t -d -v
  13. - go build -v
  14. when:
  15. event:
  16. - push
  17. - pull_request
  18. - name: test-sqlite
  19. pull: default
  20. image: golang:1.10
  21. depends_on:
  22. - build
  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.10
  33. depends_on:
  34. - build
  35. commands:
  36. - "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(mysql)/xorm_test\" -coverprofile=coverage2-1.txt -covermode=atomic"
  37. - "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(mysql)/xorm_test\" -cache=true -coverprofile=coverage2-2.txt -covermode=atomic"
  38. when:
  39. event:
  40. - push
  41. - pull_request
  42. - name: test-mysql-utf8mb4
  43. pull: default
  44. image: golang:1.10
  45. depends_on:
  46. - test-mysql
  47. commands:
  48. - "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(mysql)/xorm_test?charset=utf8mb4\" -coverprofile=coverage2.1-1.txt -covermode=atomic"
  49. - "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(mysql)/xorm_test?charset=utf8mb4\" -cache=true -coverprofile=coverage2.1-2.txt -covermode=atomic"
  50. when:
  51. event:
  52. - push
  53. - pull_request
  54. - name: test-mymysql
  55. pull: default
  56. image: golang:1.10
  57. depends_on:
  58. - test-mysql-utf8mb4
  59. commands:
  60. - "go test -v -race -db=\"mymysql\" -conn_str=\"tcp:mysql:3306*xorm_test/root/\" -coverprofile=coverage3-1.txt -covermode=atomic"
  61. - "go test -v -race -db=\"mymysql\" -conn_str=\"tcp:mysql:3306*xorm_test/root/\" -cache=true -coverprofile=coverage3-2.txt -covermode=atomic"
  62. when:
  63. event:
  64. - push
  65. - pull_request
  66. - name: test-postgres
  67. pull: default
  68. image: golang:1.10
  69. depends_on:
  70. - build
  71. commands:
  72. - "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:@pgsql/xorm_test?sslmode=disable\" -coverprofile=coverage4-1.txt -covermode=atomic"
  73. - "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:@pgsql/xorm_test?sslmode=disable\" -cache=true -coverprofile=coverage4-2.txt -covermode=atomic"
  74. when:
  75. event:
  76. - push
  77. - pull_request
  78. - name: test-postgres-schema
  79. pull: default
  80. image: golang:1.10
  81. depends_on:
  82. - build
  83. commands:
  84. - "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:@pgsql/xorm_test?sslmode=disable\" -schema=xorm -coverprofile=coverage5-1.txt -covermode=atomic"
  85. - "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"
  86. when:
  87. event:
  88. - push
  89. - pull_request
  90. - name: test-mssql
  91. pull: default
  92. image: golang:1.10
  93. depends_on:
  94. - build
  95. commands:
  96. - "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"
  97. - "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"
  98. when:
  99. event:
  100. - push
  101. - pull_request
  102. - name: test-tidb
  103. pull: default
  104. image: golang:1.10
  105. depends_on:
  106. - build
  107. commands:
  108. - "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(tidb:4000)/xorm_test\" -ignore_select_update=true -coverprofile=coverage7-1.txt -covermode=atomic"
  109. - "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"
  110. when:
  111. event:
  112. - push
  113. - pull_request
  114. - name: test-end
  115. pull: default
  116. image: golang:1.10
  117. depends_on:
  118. - test-sqlite
  119. - test-mysql
  120. - test-mysql-utf8mb4
  121. - test-mymysql
  122. - test-postgres
  123. - test-postgres-schema
  124. - test-mssql
  125. - test-tidb
  126. commands:
  127. - echo "go1.10 build end"
  128. when:
  129. event:
  130. - push
  131. - pull_request
  132. services:
  133. - name: mysql
  134. pull: default
  135. image: mysql:5.7
  136. environment:
  137. MYSQL_ALLOW_EMPTY_PASSWORD: yes
  138. MYSQL_DATABASE: xorm_test
  139. when:
  140. event:
  141. - push
  142. - tag
  143. - pull_request
  144. - name: pgsql
  145. pull: default
  146. image: postgres:9.5
  147. environment:
  148. POSTGRES_DB: xorm_test
  149. POSTGRES_USER: postgres
  150. when:
  151. event:
  152. - push
  153. - tag
  154. - pull_request
  155. - name: mssql
  156. pull: default
  157. image: microsoft/mssql-server-linux:latest
  158. environment:
  159. ACCEPT_EULA: Y
  160. SA_PASSWORD: yourStrong(!)Password
  161. MSSQL_PID: Developer
  162. when:
  163. event:
  164. - push
  165. - tag
  166. - pull_request
  167. - name: tidb
  168. pull: default
  169. image: pingcap/tidb:v3.0.3
  170. when:
  171. event:
  172. - push
  173. - tag
  174. - pull_request
  175. ---
  176. kind: pipeline
  177. name: go1.13-test
  178. steps:
  179. - name: build
  180. pull: default
  181. image: golang:1.13
  182. environment:
  183. GO111MODULE: "on"
  184. GOPROXY: "https://goproxy.cn"
  185. commands:
  186. - go build -v
  187. - go vet
  188. when:
  189. event:
  190. - push
  191. - pull_request
  192. - name: test-sqlite
  193. pull: default
  194. image: golang:1.13
  195. environment:
  196. GO111MODULE: "on"
  197. GOPROXY: "https://goproxy.cn"
  198. commands:
  199. - "go test -v -race -db=\"sqlite3\" -conn_str=\"./test.db\" -coverprofile=coverage1-1.txt -covermode=atomic"
  200. - "go test -v -race -db=\"sqlite3\" -conn_str=\"./test.db\" -cache=true -coverprofile=coverage1-2.txt -covermode=atomic"
  201. when:
  202. event:
  203. - push
  204. - pull_request
  205. - name: test-mysql
  206. pull: default
  207. image: golang:1.13
  208. environment:
  209. GO111MODULE: "on"
  210. GOPROXY: "https://goproxy.cn"
  211. commands:
  212. - "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(mysql)/xorm_test\" -coverprofile=coverage2-1.txt -covermode=atomic"
  213. - "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(mysql)/xorm_test\" -cache=true -coverprofile=coverage2-2.txt -covermode=atomic"
  214. when:
  215. event:
  216. - push
  217. - pull_request
  218. - name: test-mysql-utf8mb4
  219. pull: default
  220. image: golang:1.13
  221. depends_on:
  222. - test-mysql
  223. environment:
  224. GO111MODULE: "on"
  225. GOPROXY: "https://goproxy.cn"
  226. commands:
  227. - "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(mysql)/xorm_test?charset=utf8mb4\" -coverprofile=coverage2.1-1.txt -covermode=atomic"
  228. - "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(mysql)/xorm_test?charset=utf8mb4\" -cache=true -coverprofile=coverage2.1-2.txt -covermode=atomic"
  229. when:
  230. event:
  231. - push
  232. - pull_request
  233. - name: test-mymysql
  234. pull: default
  235. image: golang:1.13
  236. depends_on:
  237. - test-mysql-utf8mb4
  238. environment:
  239. GO111MODULE: "on"
  240. GOPROXY: "https://goproxy.cn"
  241. commands:
  242. - "go test -v -race -db=\"mymysql\" -conn_str=\"tcp:mysql:3306*xorm_test/root/\" -coverprofile=coverage3-1.txt -covermode=atomic"
  243. - "go test -v -race -db=\"mymysql\" -conn_str=\"tcp:mysql:3306*xorm_test/root/\" -cache=true -coverprofile=coverage3-2.txt -covermode=atomic"
  244. when:
  245. event:
  246. - push
  247. - pull_request
  248. - name: test-postgres
  249. pull: default
  250. image: golang:1.13
  251. environment:
  252. GO111MODULE: "on"
  253. GOPROXY: "https://goproxy.cn"
  254. commands:
  255. - "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:@pgsql/xorm_test?sslmode=disable\" -coverprofile=coverage4-1.txt -covermode=atomic"
  256. - "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:@pgsql/xorm_test?sslmode=disable\" -cache=true -coverprofile=coverage4-2.txt -covermode=atomic"
  257. when:
  258. event:
  259. - push
  260. - pull_request
  261. - name: test-postgres-schema
  262. pull: default
  263. image: golang:1.13
  264. environment:
  265. GO111MODULE: "on"
  266. GOPROXY: "https://goproxy.cn"
  267. commands:
  268. - "go test -v -race -db=\"postgres\" -conn_str=\"postgres://postgres:@pgsql/xorm_test?sslmode=disable\" -schema=xorm -coverprofile=coverage5-1.txt -covermode=atomic"
  269. - "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"
  270. when:
  271. event:
  272. - push
  273. - pull_request
  274. - name: test-mssql
  275. pull: default
  276. image: golang:1.13
  277. environment:
  278. GO111MODULE: "on"
  279. GOPROXY: "https://goproxy.cn"
  280. commands:
  281. - "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"
  282. - "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"
  283. when:
  284. event:
  285. - push
  286. - pull_request
  287. - name: test-tidb
  288. pull: default
  289. image: golang:1.13
  290. environment:
  291. GO111MODULE: "on"
  292. GOPROXY: "https://goproxy.cn"
  293. commands:
  294. - "go test -v -race -db=\"mysql\" -conn_str=\"root:@tcp(tidb:4000)/xorm_test\" -ignore_select_update=true -coverprofile=coverage7-1.txt -covermode=atomic"
  295. - "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"
  296. when:
  297. event:
  298. - push
  299. - pull_request
  300. - name: merge_coverage
  301. pull: default
  302. image: golang:1.13
  303. environment:
  304. GO111MODULE: "on"
  305. GOPROXY: "https://goproxy.cn"
  306. depends_on:
  307. - build
  308. - test-sqlite
  309. - test-mysql
  310. - test-mysql-utf8mb4
  311. - test-mymysql
  312. - test-postgres
  313. - test-postgres-schema
  314. - test-mssql
  315. - test-tidb
  316. commands:
  317. - go get github.com/wadey/gocovmerge
  318. - 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
  319. when:
  320. event:
  321. - push
  322. - pull_request
  323. services:
  324. - name: mysql
  325. pull: default
  326. image: mysql:5.7
  327. environment:
  328. MYSQL_ALLOW_EMPTY_PASSWORD: yes
  329. MYSQL_DATABASE: xorm_test
  330. when:
  331. event:
  332. - push
  333. - tag
  334. - pull_request
  335. - name: pgsql
  336. pull: default
  337. image: postgres:9.5
  338. environment:
  339. POSTGRES_DB: xorm_test
  340. POSTGRES_USER: postgres
  341. when:
  342. event:
  343. - push
  344. - tag
  345. - pull_request
  346. - name: mssql
  347. pull: default
  348. image: microsoft/mssql-server-linux:latest
  349. environment:
  350. ACCEPT_EULA: Y
  351. SA_PASSWORD: yourStrong(!)Password
  352. MSSQL_PID: Developer
  353. when:
  354. event:
  355. - push
  356. - tag
  357. - pull_request
  358. - name: tidb
  359. pull: default
  360. image: pingcap/tidb:v3.0.3
  361. when:
  362. event:
  363. - push
  364. - tag
  365. - pull_request