diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cd9fd9211a..fccf60117f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -65,30 +65,19 @@ jobs: - run: echo "JAVA8_HOME=${JAVA_HOME}" >> $GITHUB_ENV - uses: actions/setup-java@v3 with: - java-version: 11 + java-version: 17 distribution: temurin - - run: echo "JAVA11_HOME=${JAVA_HOME}" >> $GITHUB_ENV - - name: Compile with Java 11 + - name: Compile with Java 17 and run tests with Java 8 shell: bash run: | set -x export JAVA_HOME=$JAVA11_HOME export PATH=${JAVA_HOME}/bin:$PATH - # Why not compile? It's because the process needs to package jar so - # that gapic-generator-java module can use testlib modules of gax. + # Maven surefire plugin lets us to specify the JVM when running tests via + # the "jvm" system property. mvn verify --batch-mode --no-transfer-progress -Dcheckstyle.skip \ - -DskipTests -Dfmt.skip - - name: Run test with Java 8 for all modules except gapic-generator-java - shell: bash - run: | - set -x - export JAVA_HOME=$JAVA8_HOME - export PATH=${JAVA_HOME}/bin:$PATH - # useIncrementalCompilation=false to avoid recompiling classes - # generated by Java 11 compiler above. - mvn -B -ntp test --projects '!gapic-generator-java' \ - -Dcheckstyle.skip -Dmaven.compiler.useIncrementalCompilation=false \ - -Dfmt.skip + -Dfmt.skip \ + -Djvm="${JAVA8_HOME}/bin/java" build-java8-gapic-generator-java: name: "build(8) for gapic-generator-java" diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg index a24ffe55b9..de40730e6d 100644 --- a/.kokoro/release/common.cfg +++ b/.kokoro/release/common.cfg @@ -9,7 +9,7 @@ build_file: "gapic-generator-java/.kokoro/trampoline.sh" # Configure the docker image for kokoro-trampoline. env_vars: { key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/java11" + value: "gcr.io/cloud-devrel-kokoro-resources/java17" } before_action {