run_go_tests•1.22 kB
#!/usr/bin/env bash
# Copyright 2025 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
#
# 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.
#
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
TOP_DIR=$(git rev-parse --show-toplevel)
# We're concerned about only the release versions of Go, not "tip", but it has
# been included as an example in case it is needed in the future.
GO_VERSIONS=(
"1.23.7"
"1.24.1"
#"tip" # Fetches and builds the latest version of go from source and is slow.
)
cd "${TOP_DIR}/go"
for VERSION in "${GO_VERSIONS[@]}"; do
echo "Running tests with Go ${VERSION}..."
pushd "${TOP_DIR}/go" &>/dev/null
"${TOP_DIR}/bin/golang" "${VERSION}" test ./... || true # TODO: Skip failures temporarily.
popd &>/dev/null
done