Skip to content

chore: Run Java 7 Tests #1721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,29 @@ jobs:
with:
distribution: zulu
java-version: ${{matrix.java}}
- run: java -version
- run: .kokoro/build.sh
env:
JOB_TYPE: test
units-java7:
name: "units (7)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: stCarolas/setup-maven@v4
with:
maven-version: 3.1.1
- uses: actions/setup-java@v3
with:
java-version: 7
distribution: zulu
# - run: echo "JAVA7_HOME=${JAVA_HOME}" >> $GITHUB_ENV
# shell: bash
# - uses: actions/setup-java@v3
# with:
# java-version: 8
# distribution: zulu
# - run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV
# shell: bash
- run: .kokoro/build.sh
env:
JOB_TYPE: test
Expand Down
16 changes: 12 additions & 4 deletions .kokoro/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@ cd ${scriptDir}/..
source ${scriptDir}/common.sh

# Print out Maven & Java version
mvn -version
echo ${JOB_TYPE}
mvn -v
java -version

#if [ ! -z "${JAVA7_HOME}" ]; then
# setJava "${JAVA7_HOME}"
#fi

# attempt to install 3 times with exponential backoff (starting with 10 seconds)
retry_with_backoff 3 10 \
mvn install -B -V -ntp \
mvn install -B -V \
-DskipTests=true \
-Dclirr.skip=true \
-Denforcer.skip=true \
Expand All @@ -42,12 +46,16 @@ if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTI
export GOOGLE_APPLICATION_CREDENTIALS=$(realpath ${KOKORO_GFILE_DIR}/${GOOGLE_APPLICATION_CREDENTIALS})
fi

#if [ ! -z "${JAVA8_HOME}" ]; then
# setJava "${JAVA8_HOME}"
#fi

RETURN_CODE=0
set +e

case ${JOB_TYPE} in
test)
mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true
mvn test -B -Dclirr.skip=true -Denforcer.skip=true
RETURN_CODE=$?
;;
lint)
Expand Down
10 changes: 7 additions & 3 deletions .kokoro/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ function retry_with_backoff {
attempts_left=$1
sleep_seconds=$2
shift 2
command=$@

command=$*

# store current flag state
flags=$-
Expand Down Expand Up @@ -57,4 +56,9 @@ function now() { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n'; }
function msg() { println "$*" >&2; }
function println() { printf '%s\n' "$(now) $*"; }

## Helper comment to trigger updated repo dependency release
## Helper comment to trigger updated repo dependency release

#function setJava() {
# export JAVA_HOME=$1
# export PATH=${JAVA_HOME}/bin:$PATH
#}