diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e3bb26e37..5c89e3371 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 diff --git a/.kokoro/build.sh b/.kokoro/build.sh index a68837b7a..18229a2a7 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -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 \ @@ -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) diff --git a/.kokoro/common.sh b/.kokoro/common.sh index f8f957af1..6de642d67 100644 --- a/.kokoro/common.sh +++ b/.kokoro/common.sh @@ -17,8 +17,7 @@ function retry_with_backoff { attempts_left=$1 sleep_seconds=$2 shift 2 - command=$@ - + command=$* # store current flag state flags=$- @@ -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 \ No newline at end of file +## Helper comment to trigger updated repo dependency release + +#function setJava() { +# export JAVA_HOME=$1 +# export PATH=${JAVA_HOME}/bin:$PATH +#} \ No newline at end of file