kokoro: fix check-style It wasn't running in the radial-builder image, so the using.sh script failed. And that failure was not detected. Use the radial-builder image so we can get specified versions of clang (for clang-format) and gofmt. Bug: crbug.com/397705723 Change-Id: Ifc68bb0e19f9d89a00189ab5f0d17b4a3e10b691 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/75028 Reviewed-by: Shahbaz Youssefi <syoussefi@google.com> Tested-by: Shahbaz Youssefi <syoussefi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com>
diff --git a/tests/kokoro/gcp_ubuntu/check_style-docker.sh b/tests/kokoro/gcp_ubuntu/check_style-docker.sh new file mode 100755 index 0000000..d7e871d --- /dev/null +++ b/tests/kokoro/gcp_ubuntu/check_style-docker.sh
@@ -0,0 +1,16 @@ +#!/bin/bash + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd )" + +set -e # Fail on first failure + +. /bin/using.sh + +set -x # Display commands being run. + +using clang-13.0.1 +using go-1.23.4 + +# Run presubmit tests +cd "$SCRIPT_DIR/../../.." +./tests/presubmit.sh
diff --git a/tests/kokoro/gcp_ubuntu/check_style.sh b/tests/kokoro/gcp_ubuntu/check_style.sh index e9e35a9..c16df08 100755 --- a/tests/kokoro/gcp_ubuntu/check_style.sh +++ b/tests/kokoro/gcp_ubuntu/check_style.sh
@@ -1,16 +1,26 @@ #!/bin/bash -. /bin/using.sh +# Copyright 2022 The SwiftShader Authors. All Rights Reserved. +# +# 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 +# +# http://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. -set -x # Display commands being run. +set -e # Fail on any error. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd )" +ROOT_DIR="$( cd "${SCRIPT_DIR}/../../.." >/dev/null 2>&1 && pwd )" -using clang-13.0.1 - -# Set up env vars -export CLANG_FORMAT=`which clang-format` - -# Run presubmit tests -cd git/SwiftShader -./tests/presubmit.sh +docker run --rm -i \ + --volume "${ROOT_DIR}:${ROOT_DIR}" \ + --workdir "${ROOT_DIR}" \ + --entrypoint "${SCRIPT_DIR}/check_style-docker.sh" \ + "gcr.io/shaderc-build/radial-build:latest"