improve drone

This commit is contained in:
Lunny Xiao 2021-06-10 20:24:21 +08:00
parent deb9572f6a
commit a886ae90b5
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 31 additions and 39 deletions

View File

@ -1,6 +1,10 @@
--- ---
kind: pipeline kind: pipeline
name: test-sqlite name: test-mysql
environment:
GO111MODULE: "on"
GOPROXY: "https://goproxy.io"
CGO_ENABLED: 1
trigger: trigger:
ref: ref:
- refs/heads/master - refs/heads/master
@ -8,49 +12,35 @@ trigger:
steps: steps:
- name: test-vet - name: test-vet
image: golang:1.15 image: golang:1.15
environment: volumes:
GO111MODULE: "on" - name: cache
GOPROXY: "https://goproxy.io" path: /go/pkg/mod
CGO_ENABLED: 1
GOMODCACHE: '/drone/src/pkg.mod'
GOCACHE: '/drone/src/pkg.build'
commands: commands:
- make vet - make vet
- name: test-sqlite
image: golang:1.15
volumes:
- name: cache
path: /go/pkg/mod
depends_on:
- test-vet
commands:
- make fmt-check - make fmt-check
- make test - make test
- make test-sqlite3 - make test-sqlite3
- TEST_CACHE_ENABLE=true make test-sqlite3 - TEST_CACHE_ENABLE=true make test-sqlite3
- TEST_QUOTE_POLICY=reserved make test-sqlite3 - TEST_QUOTE_POLICY=reserved make test-sqlite3
- make test-sqlite
- name: test-sqlite - TEST_CACHE_ENABLE=true make test-sqlite
image: golang:1.15 - TEST_QUOTE_POLICY=reserved make test-sqlite
environment:
GO111MODULE: "on"
GOPROXY: "https://goproxy.io"
CGO_ENABLED: 1
GOMODCACHE: '/drone/src/pkg.mod'
GOCACHE: '/drone/src/pkg.build'
commands:
- make test-sqlite
- TEST_CACHE_ENABLE=true make test-sqlite
- TEST_QUOTE_POLICY=reserved make test-sqlite
---
kind: pipeline
name: test-mysql
trigger:
ref:
- refs/heads/master
- refs/pull/*/head
steps:
- name: test-mysql - name: test-mysql
image: golang:1.15 image: golang:1.15
volumes:
- name: cache
path: /go/pkg/mod
depends_on:
- test-vet
environment: environment:
GO111MODULE: "on"
GOPROXY: "https://goproxy.io"
CGO_ENABLED: 1
GOMODCACHE: '/drone/src/pkg.mod'
GOCACHE: '/drone/src/pkg.build'
TEST_MYSQL_HOST: mysql TEST_MYSQL_HOST: mysql
TEST_MYSQL_CHARSET: utf8 TEST_MYSQL_CHARSET: utf8
TEST_MYSQL_DBNAME: xorm_test TEST_MYSQL_DBNAME: xorm_test
@ -61,14 +51,13 @@ steps:
- name: test-mysql-utf8mb4 - name: test-mysql-utf8mb4
image: golang:1.15 image: golang:1.15
volumes:
- name: cache
path: /go/pkg/mod
depends_on: depends_on:
- test-mysql - test-mysql
- test-sqlite
environment: environment:
GO111MODULE: "on"
GOPROXY: "https://goproxy.io"
CGO_ENABLED: 1
GOMODCACHE: '/drone/src/pkg.mod'
GOCACHE: '/drone/src/pkg.build'
TEST_MYSQL_HOST: mysql TEST_MYSQL_HOST: mysql
TEST_MYSQL_CHARSET: utf8mb4 TEST_MYSQL_CHARSET: utf8mb4
TEST_MYSQL_DBNAME: xorm_test TEST_MYSQL_DBNAME: xorm_test
@ -77,6 +66,9 @@ steps:
commands: commands:
- make test-mysql - make test-mysql
- TEST_QUOTE_POLICY=reserved make test-mysql - TEST_QUOTE_POLICY=reserved make test-mysql
volumes:
- name: cache
temp: {}
services: services:
- name: mysql - name: mysql