add build caching

This commit is contained in:
Nick Craig-Wood 2019-08-05 12:13:24 +01:00
parent 1259785329
commit 5e69e87ea7

View File

@ -52,6 +52,7 @@ strategy:
go1.9: go1.9:
imageName: ubuntu-16.04 imageName: ubuntu-16.04
gorootDir: /usr/local gorootDir: /usr/local
GOCACHE: '' # build caching only came in go1.10
GO_VERSION: go1.9.7 GO_VERSION: go1.9.7
MAKE_QUICKTEST: true MAKE_QUICKTEST: true
go1.10: go1.10:
@ -104,7 +105,17 @@ steps:
key: go-build-cache | $(Agent.JobName) key: go-build-cache | $(Agent.JobName)
path: $(GOCACHE) path: $(GOCACHE)
displayName: Cache go build displayName: Cache go build
condition: ne( variables['GOCACHE'], '' )
- bash: |
mkdir -p $(GOCACHE)
echo "not empty" > $(GOCACHE)/not_empty.txt
echo "GOCACHE=" $(GOCACHE)
ls -R $(GOCACHE)
continueOnError: true
displayName: Create cache dir
condition: ne( variables['GOCACHE'], '' )
# Install Libraries (varies by platform) # Install Libraries (varies by platform)
- bash: | - bash: |
@ -163,8 +174,6 @@ steps:
env env
printf "\n\nRclone environment:\n\n" printf "\n\nRclone environment:\n\n"
make vars make vars
mkdir -p $(GOCACHE)
echo > $(GOCACHE)/.nonempty
workingDirectory: '$(modulePath)' workingDirectory: '$(modulePath)'
displayName: Print Go version and environment displayName: Print Go version and environment