Skip to content

Commit

Permalink
chore: Test script
Browse files Browse the repository at this point in the history
  • Loading branch information
lqiu96 committed Sep 10, 2024
1 parent f843237 commit c77397e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
java-version: 17
- run: java -version
- run: .kokoro/build.bat
env:
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
java-version: 17
- run: java -version
- run: .kokoro/build.sh
env:
Expand Down
22 changes: 11 additions & 11 deletions .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ echo ${JOB_TYPE}
# Store the current Java version since the version may change when installing sdk-platform-java
current_java_home=$JAVA_HOME

# testing-infra-docker has Java 11 installed in java8 docker container. Use this as sdk-platform-java
# needs Java 11+ to run with GraalVM. For GH actions, JAVA11_HOME does not exist and would skip this.
if [ ! -z "${JAVA11_HOME}" ]; then
export JAVA_HOME="${JAVA11_HOME}"
export PATH=${JAVA_HOME}/bin:$PATH
fi

# Get the current proto runtime version used in this repo
CURRENT_PROTO_VERSION=$(mvn -ntp help:effective-pom |
sed -n "/<artifactId>protobuf-java<\/artifactId>/,/<\/dependency>/ {
Expand All @@ -53,6 +46,13 @@ echo "The latest proto version is: ${LATEST_PROTO_VERSION}"

# Only reinstall shared-deps again to test for a newer proto version
if [[ "${CURRENT_PROTO_VERSION}" != "${LATEST_PROTO_VERSION}" ]]; then
# testing-infra-docker has Java 11 installed in java8 docker container. Use this as sdk-platform-java
# needs Java 11+ to run with GraalVM. For GH actions, JAVA11_HOME does not exist and would skip this.
if [ ! -z "${JAVA11_HOME}" ]; then
export JAVA_HOME="${JAVA11_HOME}"
export PATH=${JAVA_HOME}/bin:$PATH
fi

pushd /tmp
git clone https://github.com/googleapis/sdk-platform-java.git
pushd sdk-platform-java
Expand Down Expand Up @@ -96,11 +96,11 @@ if [[ "${CURRENT_PROTO_VERSION}" != "${LATEST_PROTO_VERSION}" ]]; then
# "${pom}"
fi
done
fi

# Reset back to the original Java version if changed
export JAVA_HOME="${current_java_home}"
export PATH=${JAVA_HOME}/bin:$PATH
# Reset back to the original Java version if changed
export JAVA_HOME="${current_java_home}"
export PATH=${JAVA_HOME}/bin:$PATH
fi

# attempt to install 3 times with exponential backoff (starting with 10 seconds)
retry_with_backoff 3 10 \
Expand Down

0 comments on commit c77397e

Please sign in to comment.