From 0223119d73e54f31811114dbb7b5b031e762b1d7 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Thu, 22 Jun 2023 15:09:31 +0000 Subject: [PATCH 1/2] chore: Java 8 unit test to build code in Java 17 and run tests on Java 8 (#1800) * Our Java projects are configured to produce Java 8-compatible bytecode via https://github.com/googleapis/java-shared-config/blob/main/pom.xml#L848. This unit test change ensures this config is applied correctly. * This change also switches the JDK distribution of GitHub Actions to temurin from zulu. * For the repositories that mark "dependencies (8)" and "dependencies (11)" as required, they should point to only "dependencies (17)" via `.github/sync-repo-settings.yaml` and repo's Settings tab. Source-Link: https://github.com/googleapis/synthtool/commit/cbe010084fc59dc15730c86e9b8e03ddac1de050 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:32851debfefed2b66038e0141f1b5c2103bb59ba80b7475adbc10ef7abab3de7 --- .github/.OwlBot.lock.yaml | 4 ++-- .github/dependabot.yml | 6 ++++-- .github/workflows/ci.yaml | 26 ++++++++++++++++++++++++-- .kokoro/build.sh | 3 ++- 4 files changed, 32 insertions(+), 7 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 73568a1e99..47a70ea40c 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest - digest: sha256:af2eda87a54601ae7b7b2be5055c17b43ac98a7805b586772db314de8a7d4a1d -# created: 2023-06-16T02:10:09.149325782Z + digest: sha256:32851debfefed2b66038e0141f1b5c2103bb59ba80b7475adbc10ef7abab3de7 +# created: 2023-06-22T15:06:52.039318836Z diff --git a/.github/dependabot.yml b/.github/dependabot.yml index fde1ced49f..203f9eaccf 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,7 +6,8 @@ updates: interval: "daily" # Disable version updates for Maven dependencies # we use renovate-bot as well as shared-dependencies BOM to update maven dependencies. - ignore: "*" + ignore: + - dependency-name: "*" - package-ecosystem: "pip" directory: "/" schedule: @@ -14,4 +15,5 @@ updates: # Disable version updates for pip dependencies # If a security vulnerability comes in, we will be notified about # it via template in the synthtool repository. - ignore: "*" + ignore: + - dependency-name: "*" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e3bb26e377..65436cde41 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,7 +25,7 @@ jobs: strategy: fail-fast: false matrix: - java: [8, 11, 17] + java: [11, 17] steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 @@ -36,6 +36,28 @@ jobs: - run: .kokoro/build.sh env: JOB_TYPE: test + units-java8: + # Building using Java 17 and run the tests with Java 8 runtime + name: "units (8)" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + java-version: 8 + distribution: zulu + - name: "Set jvm system property environment variable for surefire plugin (unit tests)" + # Maven surefire plugin (unit tests) allows us to specify JVM to run the tests. + # https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm + run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java" >> $GITHUB_ENV + shell: bash + - uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: zulu + - run: .kokoro/build.sh + env: + JOB_TYPE: test windows: runs-on: windows-latest steps: @@ -54,7 +76,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [8, 11, 17] + java: [17] steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 2904e0d4a2..605555ecae 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -47,7 +47,8 @@ set +e case ${JOB_TYPE} in test) - mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true + echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}" + mvn test -B -ntp -Dclirr.skip=true -Denforcer.skip=true ${SUREFIRE_JVM_OPT} RETURN_CODE=$? ;; lint) From f67b1c1a4f707a271108c30243daf153108b7df1 Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Thu, 22 Jun 2023 12:02:25 -0400 Subject: [PATCH 2/2] dependencies (17) --- .github/sync-repo-settings.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index f871299692..4ee8994373 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -8,8 +8,7 @@ branchProtectionRules: requiresCodeOwnerReviews: true requiresStrictStatusChecks: false requiredStatusCheckContexts: - - dependencies (8) - - dependencies (11) + - dependencies (17) - lint - clirr - units (8)