From af9a972760e8103c678610966991bdf95381d381 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 5 Aug 2019 10:16:40 +0100 Subject: [PATCH] add build caching --- azure-pipelines.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a0473df4c..78e3d9043 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -71,6 +71,7 @@ pool: variables: GOROOT: $(gorootDir)/go GOPATH: $(system.defaultWorkingDirectory)/gopath + GOCACHE: $(system.defaultWorkingDirectory)/gocache GOBIN: $(GOPATH)/bin modulePath: '$(GOPATH)/src/github.com/$(build.repository.name)' GO111MODULE: 'off' @@ -95,14 +96,14 @@ steps: shopt -s extglob shopt -s dotglob mv !(gopath) '$(modulePath)' - mkdir -p $(HOME)/.cache/go-build + mkdir -p $(GOCACHE) displayName: Remove old Go, set GOBIN/GOROOT, and move project into GOPATH - task: CacheBeta@0 continueOnError: true inputs: key: go-build-cache | $(Agent.JobName) - path: $(HOME)/.cache/go-build + path: $(GOCACHE) displayName: Cache go build # Install Libraries (varies by platform)