#!/bin/bash

# Copyright 2019 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 the project with bazel using Kokoro.

set -e
set -x

# Print the UTC time when set -x is on
export PS4='[$(date -u "+%T %Z")] '

# Check these exist and print the versions for later debugging
bazel --version
python3 -V

export PYTHON_BIN="$(which python3)"

# Kokoro checks out the repository here.
cd ${KOKORO_ARTIFACTS_DIR?}/github/iree
echo "Checking out submodules"
git submodule update --init --depth 1000 --jobs 8

echo "Building and testing with bazel"
./build_tools/scripts/bazel_build.sh

#!/bin/bash

# Copyright 2019 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 the project with bazel using Kokoro.

set -e
set -x

# Print the UTC time when set -x is on
export PS4='[$(date -u "+%T %Z")] '

# Check these exist and print the versions for later debugging
bazel --version
python3 -V

export PYTHON_BIN="$(which python3)"

# Kokoro checks out the repository here.
cd ${KOKORO_ARTIFACTS_DIR?}/github/iree
echo "Initializing submodules"
./git_scripts/submodule_versions.py init

echo "Building and testing with bazel"
./build_tools/scripts/bazel_build.sh

Make kokoro import from SUBMODULE_VERSIONS
Make kokoro import from SUBMODULE_VERSIONS

This allows originating submodule changes from upstream. The submodule version check will fail on such a PR, but we can test what it will look like after the submodule sync action has made things consistent. Note that this may mean that if someone sends a PR that only updates submodules in the git state they'll get failing presubmits on build. The submodule check presubmit should mitigate the confusion there.

Depends on #471

Closes https://github.com/google/iree/pull/470

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/iree/pull/470 from GMNGeoffrey:kokoro_submodule_sync 04e01a226a26f2bf68a1d19c0b2da0ec7b4bee5b
PiperOrigin-RevId: 289577276
