steps:
# pull the latest docker image contains bazel + android SDK
- name: gcr.io/cloud-builders/docker
  args: ['pull', 'gcr.io/$PROJECT_ID/bazel-android:latest']
# build the docker image, caching from the latest image
- name: gcr.io/cloud-builders/docker
  args: [
          'build',
          '--tag', 'gcr.io/$PROJECT_ID/bazel-android:latest',
          '--cache-from',  'gcr.io/$PROJECT_ID/bazel-android:latest',
          '.'
        ]
# build the maven repository using bazel
#- name: gcr.io/$PROJECT_ID/bazel-android
#  args: ['build', '//:axt_m2repository']
# run the robolectric tests
- name: gcr.io/$PROJECT_ID/bazel-android
  args: ['test', '//core/...', '//ext/...', '//espresso/...', '//runner/...', '--test_tag_filters=robolectric', '--build_tag_filters=robolectric']

timeout: '1200s'

# use a 32 vCPU 28.8GB memory machine.
options:
  machineType: "N1_HIGHCPU_32"

# push the built docker image to google cloud storage
images: ['gcr.io/$PROJECT_ID/bazel-android:latest']

steps:
# pull the latest docker image contains bazel + android SDK
- name: gcr.io/cloud-builders/docker
  args: ['pull', 'gcr.io/$PROJECT_ID/bazel-android:latest']
# build the docker image, caching from the latest image
- name: gcr.io/cloud-builders/docker
  args: [
          'build',
          '--tag', 'gcr.io/$PROJECT_ID/bazel-android:latest',
          '--cache-from',  'gcr.io/$PROJECT_ID/bazel-android:latest',
          '.'
        ]
# build the maven repository using bazel
- name: gcr.io/$PROJECT_ID/bazel-android
  args: ['build', '//:axt_m2repository']
# run the robolectric tests
- name: gcr.io/$PROJECT_ID/bazel-android
  args: ['test', '//core/...', '//ext/...', '//espresso/...', '//runner/...', '--test_tag_filters=robolectric', '--build_tag_filters=robolectric']

timeout: '1200s'

# use a 32 vCPU 28.8GB memory machine.
options:
  machineType: "N1_HIGHCPU_32"

# push the built docker image to google cloud storage
images: ['gcr.io/$PROJECT_ID/bazel-android:latest']

Add back building of maven repo to Google Cloud CI
Add back building of maven repo to Google Cloud CI
