From 1cf080240699aa8a2566b4c73e877205447c8908 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 27 Feb 2020 11:10:14 +0800 Subject: [PATCH] enable drone cache --- .drone.yml | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index eb8ed320..28ccffa7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,8 +2,25 @@ kind: pipeline name: testing steps: + +- name: restore-cache + image: meltwater/drone-cache:dev + pull: true + settings: + backend: "filesystem" + restore: true + cache_key: "volume" + archive_format: "gzip" + mount: + - '${GOPATH}/pkg/mod' + volumes: + - name: cache + path: /tmp/cache + - name: test-vet image: golang:1.11 + depends_on: + - restore-cache environment: GO111MODULE: "on" GOPROXY: "https://goproxy.cn" @@ -14,8 +31,26 @@ steps: - push - pull_request +- name: rebuild-cache + image: meltwater/drone-cache:dev + depends_on: + - test-vet + pull: true + settings: + backend: "filesystem" + rebuild: true + cache_key: "volume" + archive_format: "gzip" + mount: + - '${GOPATH}/pkg/mod' + volumes: + - name: cache + path: /tmp/cache + - name: test-sqlite image: golang:1.12 + depends_on: + - rebuild-cache environment: GO111MODULE: "on" GOPROXY: "https://goproxy.cn" @@ -31,6 +66,8 @@ steps: - name: test-mysql image: golang:1.12 + depends_on: + - rebuild-cache environment: GO111MODULE: "on" GOPROXY: "https://goproxy.cn" @@ -49,6 +86,8 @@ steps: - name: test-mysql8 image: golang:1.12 + depends_on: + - rebuild-cache environment: GO111MODULE: "on" GOPROXY: "https://goproxy.cn" @@ -68,6 +107,7 @@ steps: - name: test-mysql-utf8mb4 image: golang:1.12 depends_on: + - rebuild-cache - test-mysql environment: GO111MODULE: "on" @@ -89,7 +129,7 @@ steps: pull: default image: golang:1.12 depends_on: - - test-mysql-utf8mb4 + - test-mysql-utf8mb4 environment: GO111MODULE: "on" GOPROXY: "https://goproxy.cn" @@ -108,6 +148,8 @@ steps: - name: test-postgres pull: default image: golang:1.12 + depends_on: + - rebuild-cache environment: GO111MODULE: "on" GOPROXY: "https://goproxy.cn" @@ -147,6 +189,8 @@ steps: - name: test-mssql pull: default image: golang:1.12 + depends_on: + - rebuild-cache environment: GO111MODULE: "on" GOPROXY: "https://goproxy.cn" @@ -165,6 +209,8 @@ steps: - name: test-tidb pull: default image: golang:1.12 + depends_on: + - rebuild-cache environment: GO111MODULE: "on" GOPROXY: "https://goproxy.cn"