google-nomulus/release/cloudbuild-kythe.yaml
Lai Jiang 4c0f221e8c Re-enable tests in RC build (#1130)
There has been a case where the CI was broken on Friday and no one
noticied or fixed it and a RC build was built with broken tests.
The tests were disabled due to unknown test failures that have since
been fixed.

Also update the machine type used by GCB to be more powerful. This is
necessary for the tests to past because N1_HIGHCPU_8 is RAM constraint
and the tests crashes. I updated all jobs to use the new type which
hopefully will make the build faster as well.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/google/nomulus/1130)
<!-- Reviewable:end -->
2021-05-05 13:53:21 -04:00

61 lines
2.2 KiB
YAML

# To run the build locally, install cloud-build-local first.
# See: https://cloud.google.com/cloud-build/docs/build-debug-locally
# In the root of a nomulus source tree, run:
# cloud-build-local --config=cloudbuild-kythe.yaml --dryrun=false \
# --substitutions _KYTHE_VERSION=[kythe_version],COMMIT_SHA=[hash] ..
# This will download kythe version ${kythe_version} (must be higher than
# v0.0.39 and build a ${hash}.kzip file for Kythe to enable cross referencing.
#
# To manually trigger a build on GCB, run:
# gcloud builds submit --config cloudbuild-kythe.yaml --substitutions \
# _KYTHE_VERSION=[kythe_version] ..
#
# To trigger a build automatically, follow the instructions below and add a trigger:
# https://cloud.google.com/cloud-build/docs/running-builds/automate-builds
steps:
# Download Kythe
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
entrypoint: /bin/bash
args:
- -c
- |
wget -q \
https://github.com/kythe/kythe/releases/download/${_KYTHE_VERSION}/kythe-${_KYTHE_VERSION}.tar.gz
tar xvf kythe-${_KYTHE_VERSION}.tar.gz
rm kythe-${_KYTHE_VERSION}.tar.gz
mv kythe-${_KYTHE_VERSION} kythe
# Build Nomulus with the Kythe wrapper
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
entrypoint: /bin/bash
args:
- -c
- |
export REAL_JAVAC=$(which javac)
export JAVAC_EXTRACTOR_JAR="$${PWD}/kythe/extractors/javac_extractor.jar"
export KYTHE_VNAMES="$${PWD}/vnames.json"
export KYTHE_ROOT_DIRECTORY="$${PWD}"
export KYTHE_OUTPUT_DIRECTORY="$${PWD}/kythe_output"
mkdir -p $${KYTHE_OUTPUT_DIRECTORY}
mkdir -p $${KYTHE_OUTPUT_DIRECTORY}/merged
./gradlew clean testClasses -x compileProdJS \
-Dno_werror=true -PenableCrossReferencing=true
# Merge kzip files
- name: 'gcr.io/${PROJECT_ID}/builder:latest'
entrypoint: /bin/bash
args:
- -c
- |
export KYTHE_OUTPUT_DIRECTORY="$${PWD}/kythe_output"
./kythe/tools/kzip merge \
--output $${KYTHE_OUTPUT_DIRECTORY}/merged/${COMMIT_SHA}.kzip \
$${KYTHE_OUTPUT_DIRECTORY}/*.kzip
artifacts:
objects:
location: 'gs://${PROJECT_ID}-codesearch'
paths:
- 'kythe_output/merged/${COMMIT_SHA}.kzip'
timeout: 3600s
options:
machineType: 'E2_HIGHCPU_32'