Skip to content

Commit

Permalink
Aesthetic rearrangement of cloudbuild.yaml
Browse files Browse the repository at this point in the history
This shuffles the order of cloudbuild.yaml around a little to group
things more, roughly into build, test, cache, e2es.

There are no functional changes, but this moves the output of the e2es
lower in the phases.
  • Loading branch information
zmerlynn committed Mar 28, 2024
1 parent 5d9f802 commit 322d413
Showing 1 changed file with 69 additions and 68 deletions.
137 changes: 69 additions & 68 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,6 @@ steps:
dir: build
env: ['REGISTRY=${_REGISTRY}']
args: [-j, '4', push]

#
# Build all the SDKs
#
- name: make-docker
id: build-sdks
waitFor:
Expand All @@ -179,18 +175,6 @@ steps:
dir: build
args: [-j, '4', --output-sync=recurse, build-sdks]

#
# Cache the cpp sdk build directory, to speed up subsequent builds (considerably)
#
- name: us-docker.pkg.dev/$PROJECT_ID/ci/save_cache
args:
- --bucket=gs://$_CACHE_BUCKET
- --key=$_CPP_SDK_BUILD_CACHE_KEY-$( checksum sdks/cpp/CMakeLists.txt )
- --path=sdks/cpp/.build
id: cpp-sdk-build-save-cache
waitFor:
- build-sdks

#
# Run the all the automated tests (except e2e) in parallel
#
Expand All @@ -204,6 +188,30 @@ steps:
dir: build
args: [-j, '5', --output-sync=target, test]

#
# SDK conformance tests
#
- name: make-docker
id: sdk-conformance
dir: build
env: ['REGISTRY=${_REGISTRY}']
args: [-j, '5', --output-sync=target, run-sdk-conformance-tests]
waitFor:
- build-images
- tests

#
# Cache the cpp sdk build directory, to speed up subsequent builds (considerably)
#
- name: us-docker.pkg.dev/$PROJECT_ID/ci/save_cache
args:
- --bucket=gs://$_CACHE_BUCKET
- --key=$_CPP_SDK_BUILD_CACHE_KEY-$( checksum sdks/cpp/CMakeLists.txt )
- --path=sdks/cpp/.build
id: cpp-sdk-build-save-cache
waitFor:
- build-sdks

#
# Cache the htmltest url checks. Faster builds, and lower network flakiness.
#
Expand All @@ -217,16 +225,54 @@ steps:
- tests

#
# Site preview
# Cache the CPP conformance build directory, to speed up subsequent builds (considerably)
#
- name: us-docker.pkg.dev/$PROJECT_ID/ci/save_cache
args:
- --bucket=gs://$_CACHE_BUCKET
- --key=$_CPP_SDK_CONFORMANCE_CACHE_KEY-$( sdks/cpp/CMakeLists.txt )
- --path=test/sdk/cpp/sdk
id: cpp-sdk-conformance-save-cache
waitFor:
- sdk-conformance

# don't promote, as it can cause failures when two deploys try and promote at the same time.
#
# Cache the Rust SDK build directory, to speed up subsequent builds (considerably)
#
- name: us-docker.pkg.dev/$PROJECT_ID/ci/save_cache
args:
- --bucket=gs://$_CACHE_BUCKET
- --key=$_RUST_SDK_BUILD_CACHE_KEY-$( checksum test/sdk/rust/Cargo.toml )
- --path=test/sdk/rust/.cargo
- --path=test/sdk/rust/.cargo-targets
- --no-clobber
id: rust-build-save-cache
waitFor:
- sdk-conformance

#
# Zip up artifacts and push to storage
#
- name: gcr.io/cloud-builders/gsutil
waitFor: [build-sdks, tests]
dir: sdks/cpp/.archives
args: [-m, cp, '*.tar.gz', gs://agones-artifacts/cpp-sdk]
- name: gcr.io/cloud-builders/gsutil
waitFor: [build-images, tests]
dir: cmd/sdk-server/bin
args: [-m, cp, '*.zip', gs://agones-artifacts/sdk-server]

#
# Site preview
#
- name: make-docker # build a preview of the website
id: site-static
waitFor: [tests]
dir: build
args: [site-static-preview, site-gen-app-yaml, SERVICE=preview]
- name: gcr.io/cloud-builders/gcloud # deploy the preview of the website
# deploy the preview of the website; # don't promote, as it can cause failures
# when two deploys try and promote at the same time.
- name: gcr.io/cloud-builders/gcloud
id: deploy-site-static
waitFor: [site-static]
dir: site
Expand All @@ -235,6 +281,10 @@ steps:
- GOPATH=/workspace/go
- GO111MODULE=on

#
# End to end tests - keep last
#

# wait for us to be the oldest ongoing build before we run e2es
- name: gcr.io/cloud-builders/gcloud
id: e2e-wait-to-become-leader
Expand Down Expand Up @@ -336,55 +386,6 @@ steps:
waitFor:
- cancel-orphan-e2e-tests

#
# SDK conformance tests
#
- name: make-docker
id: sdk-conformance
dir: build
env: ['REGISTRY=${_REGISTRY}']
args: [-j, '5', --output-sync=target, run-sdk-conformance-tests]
waitFor:
- build-images
- tests

#
# Cache the CPP conformance build directory, to speed up subsequent builds (considerably)
#
- name: us-docker.pkg.dev/$PROJECT_ID/ci/save_cache
args:
- --bucket=gs://$_CACHE_BUCKET
- --key=$_CPP_SDK_CONFORMANCE_CACHE_KEY-$( sdks/cpp/CMakeLists.txt )
- --path=test/sdk/cpp/sdk
id: cpp-sdk-conformance-save-cache
waitFor:
- sdk-conformance

#
# Cache the Rust SDK build directory, to speed up subsequent builds (considerably)
#
- name: us-docker.pkg.dev/$PROJECT_ID/ci/save_cache
args:
- --bucket=gs://$_CACHE_BUCKET
- --key=$_RUST_SDK_BUILD_CACHE_KEY-$( checksum test/sdk/rust/Cargo.toml )
- --path=test/sdk/rust/.cargo
- --path=test/sdk/rust/.cargo-targets
- --no-clobber
id: rust-build-save-cache
waitFor:
- sdk-conformance

#
# Zip up artifacts and push to storage
#
- name: gcr.io/cloud-builders/gsutil
waitFor: [build-sdks, tests]
dir: sdks/cpp/.archives
args: [-m, cp, '*.tar.gz', gs://agones-artifacts/cpp-sdk]
- name: gcr.io/cloud-builders/gsutil
waitFor: [build-images, tests]
dir: cmd/sdk-server/bin
args: [-m, cp, '*.zip', gs://agones-artifacts/sdk-server]
substitutions:
_CACHE_BUCKET: agones-build-cache
_HTMLTEST_CACHE_KEY: htmltest-0.10.1
Expand Down

0 comments on commit 322d413

Please sign in to comment.