From 97d128722c1e28454d7b5c5d87a99bb293d59c3d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 15 Oct 2021 12:03:36 -0700 Subject: [PATCH] build: add jdk 17 to java units and dependency builds (#487) * chore(java): rename master branch to main Source-Author: Neenu Shaji Source-Date: Mon Sep 27 10:04:11 2021 -0400 Source-Repo: googleapis/synthtool Source-Sha: 67ab4f9f4272ad13f4b809de47fd0dec05f425ad Source-Link: https://github.com/googleapis/synthtool/commit/67ab4f9f4272ad13f4b809de47fd0dec05f425ad * build: add jdk 17 to java units and dependency builds * update dependencies.sh to not pass MaxPermSize when jdk 17 is used. MaxPermSize is an unrecognized flag in jdk 17. Source-Author: BenWhitehead Source-Date: Mon Sep 27 11:34:46 2021 -0400 Source-Repo: googleapis/synthtool Source-Sha: a4be3384ccb92364795d981f2863f6986fcee620 Source-Link: https://github.com/googleapis/synthtool/commit/a4be3384ccb92364795d981f2863f6986fcee620 --- .../.github/blunderbuss.yml | 2 +- .../.github/workflows/ci.yaml | 21 ++++++++++------- .../.kokoro/dependencies.sh | 23 ++++++++++++++++++- java-shared-dependencies/synth.metadata | 4 ++-- 4 files changed, 38 insertions(+), 12 deletions(-) diff --git a/java-shared-dependencies/.github/blunderbuss.yml b/java-shared-dependencies/.github/blunderbuss.yml index 1a23ea42b1..2176b05432 100644 --- a/java-shared-dependencies/.github/blunderbuss.yml +++ b/java-shared-dependencies/.github/blunderbuss.yml @@ -1,5 +1,5 @@ # Configuration for the Blunderbuss GitHub app. For more info see -# https://github.com/googleapis/repo-automation-bots/tree/master/packages/blunderbuss +# https://github.com/googleapis/repo-automation-bots/tree/main/packages/blunderbuss assign_prs_by: - labels: - samples diff --git a/java-shared-dependencies/.github/workflows/ci.yaml b/java-shared-dependencies/.github/workflows/ci.yaml index 3becb5c022..2425d7234f 100644 --- a/java-shared-dependencies/.github/workflows/ci.yaml +++ b/java-shared-dependencies/.github/workflows/ci.yaml @@ -1,7 +1,7 @@ on: push: branches: - - master + - main pull_request: name: ci jobs: @@ -9,14 +9,15 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [8, 11] + java: [8, 11, 17] steps: - uses: actions/checkout@v2 - uses: stCarolas/setup-maven@v4 with: maven-version: 3.8.1 - - uses: actions/setup-java@v1 + - uses: actions/setup-java@v2 with: + distribution: zulu java-version: ${{matrix.java}} - run: java -version - run: .kokoro/build.sh @@ -29,8 +30,9 @@ jobs: - uses: stCarolas/setup-maven@v4 with: maven-version: 3.8.1 - - uses: actions/setup-java@v1 + - uses: actions/setup-java@v2 with: + distribution: zulu java-version: 8 - run: java -version - run: .kokoro/build.bat @@ -40,14 +42,15 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [8, 11] + java: [8, 11, 17] steps: - uses: actions/checkout@v2 - uses: stCarolas/setup-maven@v4 with: maven-version: 3.8.1 - - uses: actions/setup-java@v1 + - uses: actions/setup-java@v2 with: + distribution: zulu java-version: ${{matrix.java}} - run: java -version - run: .kokoro/dependencies.sh @@ -58,8 +61,9 @@ jobs: - uses: stCarolas/setup-maven@v4 with: maven-version: 3.8.1 - - uses: actions/setup-java@v1 + - uses: actions/setup-java@v2 with: + distribution: zulu java-version: 8 - run: java -version - run: .kokoro/build.sh @@ -72,8 +76,9 @@ jobs: - uses: stCarolas/setup-maven@v4 with: maven-version: 3.8.1 - - uses: actions/setup-java@v1 + - uses: actions/setup-java@v2 with: + distribution: zulu java-version: 8 - run: java -version - run: .kokoro/build.sh diff --git a/java-shared-dependencies/.kokoro/dependencies.sh b/java-shared-dependencies/.kokoro/dependencies.sh index 9030ba8f99..9a5105d7eb 100755 --- a/java-shared-dependencies/.kokoro/dependencies.sh +++ b/java-shared-dependencies/.kokoro/dependencies.sh @@ -28,7 +28,28 @@ source ${scriptDir}/common.sh java -version echo $JOB_TYPE -export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m" +function determineMavenOpts() { + local javaVersion=$( + # filter down to the version line, then pull out the version between quotes, + # then trim the version number down to its minimal number (removing any + # update or suffix number). + java -version 2>&1 | grep "version" \ + | sed -E 's/^.*"(.*?)".*$/\1/g' \ + | sed -E 's/^(1\.[0-9]\.0).*$/\1/g' + ) + + case $javaVersion in + "17") + # MaxPermSize is no longer supported as of jdk 17 + echo -n "-Xmx1024m" + ;; + *) + echo -n "-Xmx1024m -XX:MaxPermSize=128m" + ;; + esac +} + +export MAVEN_OPTS=$(determineMavenOpts) # this should run maven enforcer retry_with_backoff 3 10 \ diff --git a/java-shared-dependencies/synth.metadata b/java-shared-dependencies/synth.metadata index db8663ac7a..57d8d055d1 100644 --- a/java-shared-dependencies/synth.metadata +++ b/java-shared-dependencies/synth.metadata @@ -4,14 +4,14 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-shared-dependencies.git", - "sha": "6f53fb409d42e9de665675ac71902c8db08abc32" + "sha": "8a7d227f2a1dab9ff23d247a4e6131c817804c36" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "396d9b84a1e93880f5bf88b59ecd38a0a6dffc5e" + "sha": "a4be3384ccb92364795d981f2863f6986fcee620" } } ],