From 86875ae03660dfba049225b765af915fd8400b7c Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 9 Jun 2021 21:19:01 +0800 Subject: [PATCH 01/14] disable unnecessary clone --- .drone.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.drone.yml b/.drone.yml index ac985f71..3effd7b8 100644 --- a/.drone.yml +++ b/.drone.yml @@ -62,6 +62,8 @@ kind: pipeline name: test-sqlite depends_on: - testing +clone: + disable: true steps: - name: restore-cache image: meltwater/drone-cache:dev @@ -136,6 +138,8 @@ kind: pipeline name: test-mysql depends_on: - testing +clone: + disable: true steps: - name: restore-cache image: meltwater/drone-cache @@ -235,6 +239,8 @@ name: test-mysql8 depends_on: - test-mysql - test-sqlite +clone: + disable: true steps: - name: restore-cache image: meltwater/drone-cache @@ -308,6 +314,8 @@ kind: pipeline name: test-mariadb depends_on: - test-mysql8 +clone: + disable: true steps: - name: restore-cache image: meltwater/drone-cache @@ -381,6 +389,8 @@ kind: pipeline name: test-postgres depends_on: - test-mariadb +clone: + disable: true steps: - name: restore-cache image: meltwater/drone-cache @@ -479,6 +489,8 @@ kind: pipeline name: test-mssql depends_on: - test-postgres +clone: + disable: true steps: - name: restore-cache image: meltwater/drone-cache @@ -552,6 +564,8 @@ kind: pipeline name: test-tidb depends_on: - test-mssql +clone: + disable: true steps: - name: restore-cache image: meltwater/drone-cache @@ -620,6 +634,8 @@ kind: pipeline name: test-cockroach depends_on: - test-tidb +clone: + disable: true steps: - name: restore-cache image: meltwater/drone-cache @@ -698,6 +714,8 @@ depends_on: - test-mssql - test-tidb - test-cockroach +clone: + disable: true steps: - name: merge_coverage pull: default -- 2.40.1 From 93ca2eb2e82d8ac156aca313be37d63b0adb2d96 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 9 Jun 2021 21:23:38 +0800 Subject: [PATCH 02/14] trigger --- .drone.yml | 50 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/.drone.yml b/.drone.yml index 3effd7b8..aec6d060 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,6 +1,10 @@ --- kind: pipeline name: testing +trigger: + ref: + - refs/heads/master + - refs/pull/*/head steps: - name: restore-cache image: meltwater/drone-cache @@ -32,10 +36,6 @@ steps: volumes: - name: cache path: /go - when: - event: - - push - - pull_request - name: rebuild-cache image: meltwater/drone-cache @@ -62,6 +62,10 @@ kind: pipeline name: test-sqlite depends_on: - testing +trigger: + ref: + - refs/heads/master + - refs/pull/*/head clone: disable: true steps: @@ -138,6 +142,10 @@ kind: pipeline name: test-mysql depends_on: - testing +trigger: + ref: + - refs/heads/master + - refs/pull/*/head clone: disable: true steps: @@ -239,6 +247,10 @@ name: test-mysql8 depends_on: - test-mysql - test-sqlite +trigger: + ref: + - refs/heads/master + - refs/pull/*/head clone: disable: true steps: @@ -314,6 +326,10 @@ kind: pipeline name: test-mariadb depends_on: - test-mysql8 +trigger: + ref: + - refs/heads/master + - refs/pull/*/head clone: disable: true steps: @@ -389,6 +405,10 @@ kind: pipeline name: test-postgres depends_on: - test-mariadb +trigger: + ref: + - refs/heads/master + - refs/pull/*/head clone: disable: true steps: @@ -489,6 +509,10 @@ kind: pipeline name: test-mssql depends_on: - test-postgres +trigger: + ref: + - refs/heads/master + - refs/pull/*/head clone: disable: true steps: @@ -564,6 +588,10 @@ kind: pipeline name: test-tidb depends_on: - test-mssql +trigger: + ref: + - refs/heads/master + - refs/pull/*/head clone: disable: true steps: @@ -634,6 +662,10 @@ kind: pipeline name: test-cockroach depends_on: - test-tidb +trigger: + ref: + - refs/heads/master + - refs/pull/*/head clone: disable: true steps: @@ -714,6 +746,10 @@ depends_on: - test-mssql - test-tidb - test-cockroach +trigger: + ref: + - refs/heads/master + - refs/pull/*/head clone: disable: true steps: @@ -725,9 +761,3 @@ steps: GOPROXY: "https://goproxy.io" commands: - make coverage - when: - branch: - - master - event: - - push - - pull_request -- 2.40.1 From c8d33d58565040e3e2b4c823fc6e3eb6bff1ea68 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 10 Jun 2021 19:55:19 +0800 Subject: [PATCH 03/14] disable volume cache --- .drone.yml | 371 +---------------------------------------------------- 1 file changed, 1 insertion(+), 370 deletions(-) diff --git a/.drone.yml b/.drone.yml index aec6d060..53a9960c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -6,22 +6,6 @@ trigger: - refs/heads/master - refs/pull/*/head steps: -- name: restore-cache - image: meltwater/drone-cache - pull: always - settings: - backend: "filesystem" - restore: true - cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}' - archive_format: "gzip" - filesystem_cache_root: "/go" - mount: - - pkg.mod - - pkg.build - volumes: - - name: cache - path: /go - - name: test-vet image: golang:1.15 environment: @@ -33,29 +17,6 @@ steps: commands: - make vet - make fmt-check - volumes: - - name: cache - path: /go - -- name: rebuild-cache - image: meltwater/drone-cache - pull: true - settings: - backend: "filesystem" - rebuild: true - cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}' - archive_format: "gzip" - filesystem_cache_root: "/go" - mount: - - pkg.mod - - pkg.build - volumes: - - name: cache - path: /go - -volumes: - - name: cache - temp: {} --- kind: pipeline @@ -69,22 +30,6 @@ trigger: clone: disable: true steps: -- name: restore-cache - image: meltwater/drone-cache:dev - pull: always - settings: - backend: "filesystem" - restore: true - cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}' - archive_format: "gzip" - filesystem_cache_root: "/go" - mount: - - pkg.mod - - pkg.build - volumes: - - name: cache - path: /go - - name: test-sqlite3 image: golang:1.15 environment: @@ -94,6 +39,7 @@ steps: GOMODCACHE: '/drone/src/pkg.mod' GOCACHE: '/drone/src/pkg.build' commands: + - make test - make test-sqlite3 - TEST_CACHE_ENABLE=true make test-sqlite3 - TEST_QUOTE_POLICY=reserved make test-sqlite3 @@ -117,26 +63,6 @@ steps: - name: cache path: /go -- name: rebuild-cache - image: meltwater/drone-cache:dev - pull: true - settings: - backend: "filesystem" - rebuild: true - cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}' - archive_format: "gzip" - filesystem_cache_root: "/go" - mount: - - pkg.mod - - pkg.build - volumes: - - name: cache - path: /go - -volumes: - - name: cache - temp: {} - --- kind: pipeline name: test-mysql @@ -149,22 +75,6 @@ trigger: clone: disable: true steps: -- name: restore-cache - image: meltwater/drone-cache - pull: always - settings: - backend: "filesystem" - restore: true - cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}' - archive_format: "gzip" - filesystem_cache_root: "/go" - mount: - - pkg.mod - - pkg.build - volumes: - - name: cache - path: /go - - name: test-mysql image: golang:1.15 environment: @@ -179,13 +89,7 @@ steps: TEST_MYSQL_USERNAME: root TEST_MYSQL_PASSWORD: commands: - - make test - - make test-mysql - TEST_CACHE_ENABLE=true make test-mysql - - TEST_QUOTE_POLICY=reserved make test-mysql - volumes: - - name: cache - path: /go - name: test-mysql-utf8mb4 image: golang:1.15 @@ -204,34 +108,7 @@ steps: TEST_MYSQL_PASSWORD: commands: - make test-mysql - - TEST_CACHE_ENABLE=true make test-mysql - TEST_QUOTE_POLICY=reserved make test-mysql - volumes: - - name: cache - path: /go - -- name: rebuild-cache - image: meltwater/drone-cache - depends_on: - - test-mysql - - test-mysql-utf8mb4 - pull: true - settings: - backend: "filesystem" - rebuild: true - cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}' - archive_format: "gzip" - filesystem_cache_root: "/go" - mount: - - pkg.mod - - pkg.build - volumes: - - name: cache - path: /go - -volumes: - - name: cache - temp: {} services: - name: mysql @@ -254,22 +131,6 @@ trigger: clone: disable: true steps: -- name: restore-cache - image: meltwater/drone-cache - pull: always - settings: - backend: "filesystem" - restore: true - cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}' - archive_format: "gzip" - filesystem_cache_root: "/go" - mount: - - pkg.mod - - pkg.build - volumes: - - name: cache - path: /go - - name: test-mysql8 image: golang:1.15 environment: @@ -287,31 +148,6 @@ steps: - make test-mysql - TEST_CACHE_ENABLE=true make test-mysql - TEST_QUOTE_POLICY=reserved make test-mysql - volumes: - - name: cache - path: /go - -- name: rebuild-cache - image: meltwater/drone-cache:dev - pull: true - depends_on: - - test-mysql8 - settings: - backend: "filesystem" - rebuild: true - cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}' - archive_format: "gzip" - filesystem_cache_root: "/go" - mount: - - pkg.mod - - pkg.build - volumes: - - name: cache - path: /go - -volumes: - - name: cache - temp: {} services: - name: mysql8 @@ -333,22 +169,6 @@ trigger: clone: disable: true steps: -- name: restore-cache - image: meltwater/drone-cache - pull: always - settings: - backend: "filesystem" - restore: true - cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}' - archive_format: "gzip" - filesystem_cache_root: "/go" - mount: - - pkg.mod - - pkg.build - volumes: - - name: cache - path: /go - - name: test-mariadb image: golang:1.15 environment: @@ -366,31 +186,6 @@ steps: - make test-mysql - TEST_CACHE_ENABLE=true make test-mysql - TEST_QUOTE_POLICY=reserved make test-mysql - volumes: - - name: cache - path: /go - -- name: rebuild-cache - image: meltwater/drone-cache:dev - depends_on: - - test-mariadb - pull: true - settings: - backend: "filesystem" - rebuild: true - cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}' - archive_format: "gzip" - filesystem_cache_root: "/go" - mount: - - pkg.mod - - pkg.build - volumes: - - name: cache - path: /go - -volumes: - - name: cache - temp: {} services: - name: mariadb @@ -412,22 +207,6 @@ trigger: clone: disable: true steps: -- name: restore-cache - image: meltwater/drone-cache - pull: always - settings: - backend: "filesystem" - restore: true - cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}' - archive_format: "gzip" - filesystem_cache_root: "/go" - mount: - - pkg.mod - - pkg.build - volumes: - - name: cache - path: /go - - name: test-postgres pull: default image: golang:1.15 @@ -444,10 +223,6 @@ steps: commands: - make test-postgres - TEST_CACHE_ENABLE=true make test-postgres - - TEST_QUOTE_POLICY=reserved make test-postgres - volumes: - - name: cache - path: /go - name: test-postgres-schema pull: default @@ -466,34 +241,7 @@ steps: TEST_PGSQL_USERNAME: postgres TEST_PGSQL_PASSWORD: postgres commands: - - make test-postgres - - TEST_CACHE_ENABLE=true make test-postgres - TEST_QUOTE_POLICY=reserved make test-postgres - volumes: - - name: cache - path: /go - -- name: rebuild-cache - image: meltwater/drone-cache:dev - pull: true - depends_on: - - test-postgres-schema - settings: - backend: "filesystem" - rebuild: true - cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}' - archive_format: "gzip" - filesystem_cache_root: "/go" - mount: - - pkg.mod - - pkg.build - volumes: - - name: cache - path: /go - -volumes: - - name: cache - temp: {} services: - name: pgsql @@ -516,21 +264,6 @@ trigger: clone: disable: true steps: -- name: restore-cache - image: meltwater/drone-cache - pull: always - settings: - backend: "filesystem" - restore: true - cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}' - archive_format: "gzip" - filesystem_cache_root: "/go" - mount: - - pkg.mod - - pkg.build - volumes: - - name: cache - path: /go - name: test-mssql pull: default @@ -550,30 +283,6 @@ steps: - TEST_CACHE_ENABLE=true make test-mssql - TEST_QUOTE_POLICY=reserved make test-mssql - TEST_MSSQL_DEFAULT_VARCHAR=NVARCHAR TEST_MSSQL_DEFAULT_CHAR=NCHAR make test-mssql - volumes: - - name: cache - path: /go - -- name: rebuild-cache - image: meltwater/drone-cache:dev - pull: true - settings: - backend: "filesystem" - rebuild: true - cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}' - archive_format: "gzip" - filesystem_cache_root: "/go" - mount: - - pkg.mod - - pkg.build - volumes: - - name: cache - path: /go - -volumes: - - name: cache - temp: {} - services: - name: mssql pull: default @@ -595,22 +304,6 @@ trigger: clone: disable: true steps: -- name: restore-cache - image: meltwater/drone-cache - pull: always - settings: - backend: "filesystem" - restore: true - cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}' - archive_format: "gzip" - filesystem_cache_root: "/go" - mount: - - pkg.mod - - pkg.build - volumes: - - name: cache - path: /go - - name: test-tidb pull: default image: golang:1.15 @@ -628,29 +321,6 @@ steps: - make test-tidb - TEST_CACHE_ENABLE=true make test-tidb - TEST_QUOTE_POLICY=reserved make test-tidb - volumes: - - name: cache - path: /go - -- name: rebuild-cache - image: meltwater/drone-cache:dev - pull: true - settings: - backend: "filesystem" - rebuild: true - cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}' - archive_format: "gzip" - filesystem_cache_root: "/go" - mount: - - pkg.mod - - pkg.build - volumes: - - name: cache - path: /go - -volumes: - - name: cache - temp: {} services: - name: tidb @@ -669,22 +339,6 @@ trigger: clone: disable: true steps: -- name: restore-cache - image: meltwater/drone-cache - pull: always - settings: - backend: "filesystem" - restore: true - cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}' - archive_format: "gzip" - filesystem_cache_root: "/go" - mount: - - pkg.mod - - pkg.build - volumes: - - name: cache - path: /go - - name: test-cockroach pull: default image: golang:1.15 @@ -702,29 +356,6 @@ steps: - sleep 10 - make test-cockroach - TEST_CACHE_ENABLE=true make test-cockroach - volumes: - - name: cache - path: /go - -- name: rebuild-cache - image: meltwater/drone-cache:dev - pull: true - settings: - backend: "filesystem" - rebuild: true - cache_key: '{{ .Repo.Name }}_{{ checksum "go.mod" }}_{{ checksum "go.sum" }}_{{ arch }}_{{ os }}' - archive_format: "gzip" - filesystem_cache_root: "/go" - mount: - - pkg.mod - - pkg.build - volumes: - - name: cache - path: /go - -volumes: - - name: cache - temp: {} services: - name: cockroach -- 2.40.1 From 424d4c5cc51cc87794ac42f3d827d78f78f718f5 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 10 Jun 2021 20:03:03 +0800 Subject: [PATCH 04/14] Fix drone --- .drone.yml | 53 +++++------------------------------------------------ 1 file changed, 5 insertions(+), 48 deletions(-) diff --git a/.drone.yml b/.drone.yml index 53a9960c..3d893603 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,6 +1,6 @@ --- kind: pipeline -name: testing +name: test-sqlite trigger: ref: - refs/heads/master @@ -17,35 +17,10 @@ steps: commands: - make vet - make fmt-check - ---- -kind: pipeline -name: test-sqlite -depends_on: - - testing -trigger: - ref: - - refs/heads/master - - refs/pull/*/head -clone: - disable: true -steps: -- name: test-sqlite3 - image: golang:1.15 - environment: - GO111MODULE: "on" - GOPROXY: "https://goproxy.io" - CGO_ENABLED: 1 - GOMODCACHE: '/drone/src/pkg.mod' - GOCACHE: '/drone/src/pkg.build' - commands: - - make test - - make test-sqlite3 - - TEST_CACHE_ENABLE=true make test-sqlite3 - - TEST_QUOTE_POLICY=reserved make test-sqlite3 - volumes: - - name: cache - path: /go + - make test + - make test-sqlite3 + - TEST_CACHE_ENABLE=true make test-sqlite3 + - TEST_QUOTE_POLICY=reserved make test-sqlite3 - name: test-sqlite image: golang:1.15 @@ -59,9 +34,6 @@ steps: - make test-sqlite - TEST_CACHE_ENABLE=true make test-sqlite - TEST_QUOTE_POLICY=reserved make test-sqlite - volumes: - - name: cache - path: /go --- kind: pipeline @@ -72,8 +44,6 @@ trigger: ref: - refs/heads/master - refs/pull/*/head -clone: - disable: true steps: - name: test-mysql image: golang:1.15 @@ -128,8 +98,6 @@ trigger: ref: - refs/heads/master - refs/pull/*/head -clone: - disable: true steps: - name: test-mysql8 image: golang:1.15 @@ -166,8 +134,6 @@ trigger: ref: - refs/heads/master - refs/pull/*/head -clone: - disable: true steps: - name: test-mariadb image: golang:1.15 @@ -204,8 +170,6 @@ trigger: ref: - refs/heads/master - refs/pull/*/head -clone: - disable: true steps: - name: test-postgres pull: default @@ -261,10 +225,7 @@ trigger: ref: - refs/heads/master - refs/pull/*/head -clone: - disable: true steps: - - name: test-mssql pull: default image: golang:1.15 @@ -301,8 +262,6 @@ trigger: ref: - refs/heads/master - refs/pull/*/head -clone: - disable: true steps: - name: test-tidb pull: default @@ -336,8 +295,6 @@ trigger: ref: - refs/heads/master - refs/pull/*/head -clone: - disable: true steps: - name: test-cockroach pull: default -- 2.40.1 From bb1800b5bf8009026357e1ff5d6399c07a9d36a8 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 10 Jun 2021 20:07:09 +0800 Subject: [PATCH 05/14] Fix drone --- .drone.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 3d893603..c46904f1 100644 --- a/.drone.yml +++ b/.drone.yml @@ -38,8 +38,6 @@ steps: --- kind: pipeline name: test-mysql -depends_on: - - testing trigger: ref: - refs/heads/master -- 2.40.1 From deb9572f6aa31cfa6b7e8b00ae9237c8e0dad9b0 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 10 Jun 2021 20:09:49 +0800 Subject: [PATCH 06/14] Fix drone --- .drone.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index c46904f1..4baf1d45 100644 --- a/.drone.yml +++ b/.drone.yml @@ -323,7 +323,6 @@ services: kind: pipeline name: merge_coverage depends_on: - - testing - test-sqlite - test-mysql - test-mysql8 -- 2.40.1 From a886ae90b52d608849ac9d4847872f33833c6895 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 10 Jun 2021 20:24:21 +0800 Subject: [PATCH 07/14] improve drone --- .drone.yml | 70 ++++++++++++++++++++++++------------------------------ 1 file changed, 31 insertions(+), 39 deletions(-) diff --git a/.drone.yml b/.drone.yml index 4baf1d45..317eafc4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,6 +1,10 @@ --- kind: pipeline -name: test-sqlite +name: test-mysql +environment: + GO111MODULE: "on" + GOPROXY: "https://goproxy.io" + CGO_ENABLED: 1 trigger: ref: - refs/heads/master @@ -8,49 +12,35 @@ trigger: steps: - name: test-vet image: golang:1.15 - environment: - GO111MODULE: "on" - GOPROXY: "https://goproxy.io" - CGO_ENABLED: 1 - GOMODCACHE: '/drone/src/pkg.mod' - GOCACHE: '/drone/src/pkg.build' + volumes: + - name: cache + path: /go/pkg/mod commands: - 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 test - make test-sqlite3 - TEST_CACHE_ENABLE=true make test-sqlite3 - TEST_QUOTE_POLICY=reserved make test-sqlite3 - -- name: test-sqlite - image: golang:1.15 - 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: + - make test-sqlite + - TEST_CACHE_ENABLE=true make test-sqlite + - TEST_QUOTE_POLICY=reserved make test-sqlite - name: test-mysql image: golang:1.15 + volumes: + - name: cache + path: /go/pkg/mod + depends_on: + - test-vet 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_CHARSET: utf8 TEST_MYSQL_DBNAME: xorm_test @@ -61,14 +51,13 @@ steps: - name: test-mysql-utf8mb4 image: golang:1.15 + volumes: + - name: cache + path: /go/pkg/mod depends_on: - test-mysql + - test-sqlite 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_CHARSET: utf8mb4 TEST_MYSQL_DBNAME: xorm_test @@ -77,6 +66,9 @@ steps: commands: - make test-mysql - TEST_QUOTE_POLICY=reserved make test-mysql +volumes: +- name: cache + temp: {} services: - name: mysql -- 2.40.1 From cfc2a70e00a21564cc9c51fd422b3adab2fd85c7 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 10 Jun 2021 20:25:07 +0800 Subject: [PATCH 08/14] improve drone --- .drone.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 317eafc4..1a99777f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -315,7 +315,6 @@ services: kind: pipeline name: merge_coverage depends_on: - - test-sqlite - test-mysql - test-mysql8 - test-mariadb -- 2.40.1 From cb29997d49ad81d73672525e1aa5b9a26b4344b9 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 10 Jun 2021 20:26:13 +0800 Subject: [PATCH 09/14] improve drone --- .drone.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 1a99777f..feb60fc3 100644 --- a/.drone.yml +++ b/.drone.yml @@ -83,7 +83,6 @@ kind: pipeline name: test-mysql8 depends_on: - test-mysql - - test-sqlite trigger: ref: - refs/heads/master -- 2.40.1 From 8ed65fc60107d0d1a738987784ade71af6323c35 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 10 Jun 2021 20:32:05 +0800 Subject: [PATCH 10/14] improve drone --- .drone.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index feb60fc3..0b84ab78 100644 --- a/.drone.yml +++ b/.drone.yml @@ -56,7 +56,6 @@ steps: path: /go/pkg/mod depends_on: - test-mysql - - test-sqlite environment: TEST_MYSQL_HOST: mysql TEST_MYSQL_CHARSET: utf8mb4 -- 2.40.1 From 0a5ce27b18e88a90e9d128e4cb26c8ed6fa105e2 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 10 Jun 2021 20:39:03 +0800 Subject: [PATCH 11/14] improve drone --- .drone.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 0b84ab78..dde501f3 100644 --- a/.drone.yml +++ b/.drone.yml @@ -17,7 +17,7 @@ steps: path: /go/pkg/mod commands: - make vet -- name: test-sqlite +- name: test-sqlite3 image: golang:1.15 volumes: - name: cache @@ -26,10 +26,18 @@ steps: - test-vet commands: - make fmt-check - - make test - make test-sqlite3 - TEST_CACHE_ENABLE=true make test-sqlite3 - TEST_QUOTE_POLICY=reserved make test-sqlite3 +- name: test-sqlite + image: golang:1.15 + volumes: + - name: cache + path: /go/pkg/mod + depends_on: + - test-vet + commands: + - make test - make test-sqlite - TEST_CACHE_ENABLE=true make test-sqlite - TEST_QUOTE_POLICY=reserved make test-sqlite -- 2.40.1 From 848b76a8e0460cc6544a7af349969154f0877cc5 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 10 Jun 2021 20:45:46 +0800 Subject: [PATCH 12/14] improve drone --- .drone.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.drone.yml b/.drone.yml index dde501f3..66db315f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -26,18 +26,10 @@ steps: - test-vet commands: - make fmt-check + - make test - make test-sqlite3 - TEST_CACHE_ENABLE=true make test-sqlite3 - TEST_QUOTE_POLICY=reserved make test-sqlite3 -- name: test-sqlite - image: golang:1.15 - volumes: - - name: cache - path: /go/pkg/mod - depends_on: - - test-vet - commands: - - make test - make test-sqlite - TEST_CACHE_ENABLE=true make test-sqlite - TEST_QUOTE_POLICY=reserved make test-sqlite -- 2.40.1 From 5bc9e15b2f48245602b853f8a222591d7623ca56 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 10 Jun 2021 20:46:47 +0800 Subject: [PATCH 13/14] improve drone --- .drone.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 66db315f..e83df201 100644 --- a/.drone.yml +++ b/.drone.yml @@ -65,9 +65,11 @@ steps: commands: - make test-mysql - TEST_QUOTE_POLICY=reserved make test-mysql + volumes: - name: cache - temp: {} + host: + path: /tmp/cache services: - name: mysql -- 2.40.1 From 8ba86ac35e6970f49cdf4d5907411b738352a956 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 10 Jun 2021 21:00:07 +0800 Subject: [PATCH 14/14] improve drone --- .drone.yml | 121 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 70 insertions(+), 51 deletions(-) diff --git a/.drone.yml b/.drone.yml index e83df201..08be6a8d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,6 +12,7 @@ trigger: steps: - name: test-vet image: golang:1.15 + pull: always volumes: - name: cache path: /go/pkg/mod @@ -35,6 +36,7 @@ steps: - TEST_QUOTE_POLICY=reserved make test-sqlite - name: test-mysql image: golang:1.15 + pull: never volumes: - name: cache path: /go/pkg/mod @@ -51,6 +53,7 @@ steps: - name: test-mysql-utf8mb4 image: golang:1.15 + pull: never volumes: - name: cache path: /go/pkg/mod @@ -73,7 +76,7 @@ volumes: services: - name: mysql - pull: default + pull: never image: mysql:5.7 environment: MYSQL_ALLOW_EMPTY_PASSWORD: yes @@ -91,12 +94,11 @@ trigger: steps: - name: test-mysql8 image: golang:1.15 + pull: never + volumes: + - name: cache + path: /go/pkg/mod environment: - GO111MODULE: "on" - GOPROXY: "https://goproxy.io" - CGO_ENABLED: 1 - GOMODCACHE: '/drone/src/pkg.mod' - GOCACHE: '/drone/src/pkg.build' TEST_MYSQL_HOST: mysql8 TEST_MYSQL_CHARSET: utf8mb4 TEST_MYSQL_DBNAME: xorm_test @@ -107,9 +109,14 @@ steps: - TEST_CACHE_ENABLE=true make test-mysql - TEST_QUOTE_POLICY=reserved make test-mysql +volumes: +- name: cache + host: + path: /tmp/cache + services: - name: mysql8 - pull: default + pull: never image: mysql:8.0 environment: MYSQL_ALLOW_EMPTY_PASSWORD: yes @@ -127,12 +134,11 @@ trigger: steps: - name: test-mariadb image: golang:1.15 + pull: never + volumes: + - name: cache + path: /go/pkg/mod environment: - GO111MODULE: "on" - GOPROXY: "https://goproxy.io" - CGO_ENABLED: 1 - GOMODCACHE: '/drone/src/pkg.mod' - GOCACHE: '/drone/src/pkg.build' TEST_MYSQL_HOST: mariadb TEST_MYSQL_CHARSET: utf8mb4 TEST_MYSQL_DBNAME: xorm_test @@ -143,9 +149,14 @@ steps: - TEST_CACHE_ENABLE=true make test-mysql - TEST_QUOTE_POLICY=reserved make test-mysql +volumes: +- name: cache + host: + path: /tmp/cache + services: - name: mariadb - pull: default + pull: never image: mariadb:10.4 environment: MYSQL_ALLOW_EMPTY_PASSWORD: yes @@ -162,14 +173,12 @@ trigger: - refs/pull/*/head steps: - name: test-postgres - pull: default + pull: never image: golang:1.15 + volumes: + - name: cache + path: /go/pkg/mod environment: - GO111MODULE: "on" - GOPROXY: "https://goproxy.io" - CGO_ENABLED: 1 - GOMODCACHE: '/drone/src/pkg.mod' - GOCACHE: '/drone/src/pkg.build' TEST_PGSQL_HOST: pgsql TEST_PGSQL_DBNAME: xorm_test TEST_PGSQL_USERNAME: postgres @@ -179,16 +188,14 @@ steps: - TEST_CACHE_ENABLE=true make test-postgres - name: test-postgres-schema - pull: default + pull: never image: golang:1.15 + volumes: + - name: cache + path: /go/pkg/mod depends_on: - test-postgres environment: - GO111MODULE: "on" - GOPROXY: "https://goproxy.io" - CGO_ENABLED: 1 - GOMODCACHE: '/drone/src/pkg.mod' - GOCACHE: '/drone/src/pkg.build' TEST_PGSQL_HOST: pgsql TEST_PGSQL_SCHEMA: xorm TEST_PGSQL_DBNAME: xorm_test @@ -197,9 +204,14 @@ steps: commands: - TEST_QUOTE_POLICY=reserved make test-postgres +volumes: +- name: cache + host: + path: /tmp/cache + services: - name: pgsql - pull: default + pull: never image: postgres:9.5 environment: POSTGRES_DB: xorm_test @@ -217,14 +229,12 @@ trigger: - refs/pull/*/head steps: - name: test-mssql - pull: default + pull: never image: golang:1.15 + volumes: + - name: cache + path: /go/pkg/mod environment: - GO111MODULE: "on" - GOPROXY: "https://goproxy.io" - CGO_ENABLED: 1 - GOMODCACHE: '/drone/src/pkg.mod' - GOCACHE: '/drone/src/pkg.build' TEST_MSSQL_HOST: mssql TEST_MSSQL_DBNAME: xorm_test TEST_MSSQL_USERNAME: sa @@ -234,9 +244,15 @@ steps: - TEST_CACHE_ENABLE=true make test-mssql - TEST_QUOTE_POLICY=reserved make test-mssql - TEST_MSSQL_DEFAULT_VARCHAR=NVARCHAR TEST_MSSQL_DEFAULT_CHAR=NCHAR make test-mssql + +volumes: +- name: cache + host: + path: /tmp/cache + services: - name: mssql - pull: default + pull: always image: microsoft/mssql-server-linux:latest environment: ACCEPT_EULA: Y @@ -254,14 +270,12 @@ trigger: - refs/pull/*/head steps: - name: test-tidb - pull: default + pull: never image: golang:1.15 + volumes: + - name: cache + path: /go/pkg/mod environment: - GO111MODULE: "on" - GOPROXY: "https://goproxy.io" - CGO_ENABLED: 1 - GOMODCACHE: '/drone/src/pkg.mod' - GOCACHE: '/drone/src/pkg.build' TEST_TIDB_HOST: "tidb:4000" TEST_TIDB_DBNAME: xorm_test TEST_TIDB_USERNAME: root @@ -271,9 +285,14 @@ steps: - TEST_CACHE_ENABLE=true make test-tidb - TEST_QUOTE_POLICY=reserved make test-tidb +volumes: +- name: cache + host: + path: /tmp/cache + services: - name: tidb - pull: default + pull: never image: pingcap/tidb:v3.0.3 --- @@ -287,14 +306,12 @@ trigger: - refs/pull/*/head steps: - name: test-cockroach - pull: default + pull: never image: golang:1.15 + volumes: + - name: cache + path: /go/pkg/mod environment: - GO111MODULE: "on" - GOPROXY: "https://goproxy.io" - CGO_ENABLED: 1 - GOMODCACHE: '/drone/src/pkg.mod' - GOCACHE: '/drone/src/pkg.build' TEST_COCKROACH_HOST: "cockroach:26257" TEST_COCKROACH_DBNAME: xorm_test TEST_COCKROACH_USERNAME: root @@ -304,9 +321,14 @@ steps: - make test-cockroach - TEST_CACHE_ENABLE=true make test-cockroach +volumes: +- name: cache + host: + path: /tmp/cache + services: - name: cockroach - pull: default + pull: never image: cockroachdb/cockroach:v19.2.4 commands: - /cockroach/cockroach start --insecure @@ -330,10 +352,7 @@ clone: disable: true steps: - name: merge_coverage - pull: default + pull: never image: golang:1.15 - environment: - GO111MODULE: "on" - GOPROXY: "https://goproxy.io" commands: - make coverage -- 2.40.1