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

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