@@ -29,6 +29,13 @@ steps:
2929 - ' --key=$_HTMLTEST_CACHE_KEY'
3030 waitFor : ['-']
3131
32+ - name : gcr.io/$PROJECT_ID/restore_cache
33+ id : cpp-sdk-build-restore-cache
34+ args :
35+ - ' --bucket=gs://$_CACHE_BUCKET'
36+ - ' --key=$_CPP_SDK_BUILD_CACHE_KEY'
37+ waitFor : ['-']
38+
3239#
3340# Creates the initial make + docker build platform
3441#
@@ -119,18 +126,43 @@ steps:
119126#
120127
121128- name : " make-docker"
122- id : build
129+ id : build-images
123130 waitFor :
124131 - lint
125- - ensure-build-sdk-image-base
126132 dir : " build"
127- args : [ "-j", "4", "build"]
133+ args : [ "-j", "4", "build-images "]
128134- name : " make-docker"
129135 id : push-images
130136 waitFor :
131- - build
137+ - build-images
138+ dir : " build"
139+ args : [ "-j", "4", "push"]
140+
141+ #
142+ # Build all the SDKs
143+ #
144+
145+ - name : " make-docker"
146+ id : build-sdks
147+ waitFor :
148+ - lint
149+ - cpp-sdk-build-restore-cache
150+ - ensure-build-sdk-image-base
132151 dir : " build"
133- args : [ "-j", "3", "push"]
152+ args : [ "-j", "4", "--output-sync=target", "build-sdks"]
153+
154+ #
155+ # Cache the cpp sdk build directory, to speed up subsequent builds (considerably)
156+ #
157+
158+ - name : ' gcr.io/$PROJECT_ID/save_cache'
159+ args :
160+ - ' --bucket=gs://$_CACHE_BUCKET'
161+ - ' --key=$_CPP_SDK_BUILD_CACHE_KEY'
162+ - ' --path=sdks/cpp/.build'
163+ id : cpp-sdk-build-save-cache
164+ waitFor :
165+ - build-sdks
134166
135167#
136168# Run the all the automated tests (except e2e) in parallel
@@ -142,7 +174,6 @@ steps:
142174 - lint
143175 - ensure-build-sdk-image-base
144176 - htmltest-restore-cache
145- - build
146177 dir : " build"
147178 args : [ "-j", "5", "--output-sync=target", "test" ]
148179
@@ -202,29 +233,29 @@ steps:
202233 dir : " build"
203234 args : [ "run-sdk-conformance-tests"]
204235 waitFor :
205- - build
206- - tests
236+ - build-images
207237
208238#
209239# Zip up artifacts and push to storage
210240#
211241
212242- name : ' gcr.io/cloud-builders/gsutil'
213243 waitFor :
214- - build
244+ - build-sdks
215245 - tests
216246 dir : " sdks/cpp/.build"
217247 args : ['cp', '*.tar.gz', 'gs://agones-artifacts/cpp-sdk']
218248- name : ' gcr.io/cloud-builders/gsutil'
219249 waitFor :
220- - build
250+ - build-images
221251 - tests
222252 dir : " cmd/sdk-server/bin"
223253 args : ['cp', '*.zip', 'gs://agones-artifacts/sdk-server']
224254
225255substitutions :
226256 _CACHE_BUCKET : agones-build-cache
227257 _HTMLTEST_CACHE_KEY : htmltest-0.10.1
258+ _CPP_SDK_BUILD_CACHE_KEY : cpp-sdk-build
228259
229260tags : ['ci']
230261timeout : " 1h"
0 commit comments