blob: bc26e9596662768018de7ca2c87b978cf52819c3 [file] [log] [blame]
#!/bin/bash
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Build and test the project within the gcr.io/iree-oss/cmake using Kokoro.
set -e
set -x
# Print the UTC time when set -x is on
export PS4='[$(date -u "+%T %Z")] '
# Kokoro checks out the repository here.
WORKDIR=${KOKORO_ARTIFACTS_DIR?}/github/iree
# Mount the checked out repository, make that the working directory and run the
# tests in the cmake image.
docker run \
--volume "${WORKDIR?}:${WORKDIR?}" \
--workdir="${WORKDIR?}" \
--rm \
gcr.io/iree-oss/cmake:prod \
kokoro/gcp_ubuntu/cmake/build.sh
# Kokoro will rsync this entire directory back to the executor orchestrating the
# build which takes forever and is totally useless.
rm -rf "${KOKORO_ARTIFACTS_DIR?}/*"