diff --git a/.github/workflows/ci-java7.yaml b/.github/workflows/ci-java7.yaml index 5086c87d5..53ee14a9e 100644 --- a/.github/workflows/ci-java7.yaml +++ b/.github/workflows/ci-java7.yaml @@ -1,63 +1,60 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Github action job to test core java library features on -# downstream client libraries before they are released. -on: +'on': push: branches: - - main - pull_request: + - 1.47.x + pull_request: null name: ci-java7 jobs: units: - name: "units (7)" + name: units (7) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - # setup-java v2 or higher does not have version 1.7 - with: - java-version: 7 - distribution: zulu - architecture: x64 - - run: | - java -version - # This value is used in "-Djvm=" later - echo "JAVA7_HOME=${JAVA_HOME}" >> $GITHUB_ENV - - uses: actions/setup-java@v4 - with: - java-version: 17 - distribution: zulu - - name: Set up Maven - uses: stCarolas/setup-maven@v4.5 - with: - maven-version: 3.8.8 - - name: Build - shell: bash - run: | - # Leveraging surefire's jvm option, running the test on Java 7. - # Surefire plugin 2.22.2 is the last version for Java 7. Newer version would fail with - # "UnsupportedClassVersionError: org/apache/maven/surefire/booter/ForkedBooter" error. - - # Why are these modules are skipped? - # google-http-client-jackson2 and google-http-client-appengine do not work with Java 7 - # any more because of Jackson and appengine library are compiled for Java 8. - # dailymotion-simple-cmdline-sample and google-http-client-assembly depend on - # google-http-client-jackson2 - mvn --batch-mode --show-version -ntp test \ - --projects '!google-http-client-jackson2,!google-http-client-appengine,!samples/dailymotion-simple-cmdline-sample,!google-http-client-assembly,!google-http-client-apache-v5' \ - -Dclirr.skip=true -Denforcer.skip=true -Dmaven.javadoc.skip=true \ - -Dgcloud.download.skip=true -T 1C \ - -Dproject.surefire.version=2.22.2 \ - -Djvm=${JAVA7_HOME}/bin/java + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: 7 + distribution: zulu + architecture: x64 + - run: | + java -version + # This value is used in "-Djvm=" later + echo "JAVA7_HOME=${JAVA_HOME}" >> $GITHUB_ENV + - uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: zulu + - name: Set up Maven + uses: stCarolas/setup-maven@v4.5 + with: + maven-version: 3.8.8 + - name: Build + shell: bash + run: > + # Leveraging surefire's jvm option, running the test on Java 7. + + # Surefire plugin 2.22.2 is the last version for Java 7. Newer version + would fail with + + # "UnsupportedClassVersionError: + org/apache/maven/surefire/booter/ForkedBooter" error. + + + # Why are these modules are skipped? + + # google-http-client-jackson2 and google-http-client-appengine do not + work with Java 7 + + # any more because of Jackson and appengine library are compiled for + Java 8. + + # dailymotion-simple-cmdline-sample and google-http-client-assembly + depend on + + # google-http-client-jackson2 + + mvn --batch-mode --show-version -ntp test \ + --projects '!google-http-client-jackson2,!google-http-client-appengine,!samples/dailymotion-simple-cmdline-sample,!google-http-client-assembly,!google-http-client-apache-v5' \ + -Dclirr.skip=true -Denforcer.skip=true -Dmaven.javadoc.skip=true \ + -Dgcloud.download.skip=true -T 1C \ + -Dproject.surefire.version=2.22.2 \ + -Djvm=${JAVA7_HOME}/bin/java diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2915835ab..6f66fa137 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,23 +1,8 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# Github action job to test core java library features on -# downstream client libraries before they are released. -on: +'on': push: branches: - - main - pull_request: + - 1.47.x + pull_request: null name: ci jobs: units: @@ -25,89 +10,94 @@ jobs: strategy: fail-fast: false matrix: - java: [8, 11, 17, 24] + java: + - 8 + - 11 + - 17 + - 24 steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: ${{matrix.java}} - - run: java -version - - run: .kokoro/build.sh - env: - JOB_TYPE: test + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: test windows: runs-on: windows-latest steps: - - name: Support longpaths - run: git config --system core.longpaths true - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: 8 - - run: java -version - - run: .kokoro/build.bat - env: - JOB_TYPE: test + - name: Support longpaths + run: git config --system core.longpaths true + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 8 + - run: java -version + - run: .kokoro/build.bat + env: + JOB_TYPE: test dependencies: runs-on: ubuntu-latest strategy: matrix: - java: [8, 11, 17, 24] + java: + - 8 + - 11 + - 17 + - 24 steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: ${{matrix.java}} - - run: java -version - - run: .kokoro/dependencies.sh + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/dependencies.sh lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: 11 - - run: java -version - - run: .kokoro/build.sh - env: - JOB_TYPE: lint + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 11 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: lint clirr: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: 8 - - run: java -version - - run: .kokoro/build.sh - env: - JOB_TYPE: clirr - # compilation failure for sub-modules using source and target options 7 (this setting cannot be upgraded to Java 21 because some modules support max of Java 8) - # Hence compile in Java 8 and test in Java 21. + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 8 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: clirr units-java21: - # Building using Java 8 and run the tests with Java 21 runtime - name: "units (21)" + name: units (21) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - java-version: 21 - distribution: temurin - - 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@v4 - with: - java-version: 8 - distribution: temurin - - run: .kokoro/build.sh - env: - JOB_TYPE: test \ No newline at end of file + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: 21 + distribution: temurin + - name: >- + Set jvm system property environment variable for surefire plugin (unit + tests) + run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java" >> $GITHUB_ENV + shell: bash + - uses: actions/setup-java@v4 + with: + java-version: 8 + distribution: temurin + - run: .kokoro/build.sh + env: + JOB_TYPE: test diff --git a/.github/workflows/downstream.yaml b/.github/workflows/downstream.yaml index 1f44d518d..ec2686df3 100644 --- a/.github/workflows/downstream.yaml +++ b/.github/workflows/downstream.yaml @@ -1,8 +1,9 @@ -on: +'on': pull_request: - types: [ labeled ] + types: + - labeled branches: - - main + - 1.47.x name: downstream jobs: dependencies: @@ -11,134 +12,136 @@ jobs: strategy: fail-fast: false matrix: - java: [8] + java: + - 8 repo: - # This list needs to be updated manually until an automated solution is in place. - - accessapproval - - accesscontextmanager - - aiplatform - - analytics-admin - - analytics-data - - api-gateway - - apigee-connect - - appengine-admin - - area120-tables - - artifact-registry - - asset - - assured-workloads - - automl - - bigquery - - bigqueryconnection - - bigquerydatatransfer - - bigquerymigration - - bigqueryreservation - - bigtable - - billing - - billingbudgets - - binary-authorization - - channel - - cloudbuild - - compute - - contact-center-insights - - container - - containeranalysis - - data-fusion - - datacatalog - - dataflow - - datalabeling - - dataproc - - dataproc-metastore - - datastore - - datastream - - debugger-client - - deploy - - dialogflow - - dialogflow-cx - - dlp - - dms - - dns - - document-ai - - domains - - errorreporting - - essential-contacts - - eventarc - - filestore - - firestore - - functions - - game-servers - - gke-connect-gateway - - gkehub - - gsuite-addons - - iam-admin - - iamcredentials - - iot - - kms - - language - - life-sciences - - logging - - logging-logback - - managed-identities - - mediatranslation - - memcache - - monitoring - - monitoring-dashboards - - network-management - - network-security - - networkconnectivity - - notebooks - - orchestration-airflow - - orgpolicy - - os-config - - os-login - - phishingprotection - - policy-troubleshooter - - private-catalog - - profiler - - pubsublite - - recaptchaenterprise - - recommendations-ai - - recommender - - redis - - resource-settings - - resourcemanager - - retail - - scheduler - - secretmanager - - security-private-ca - - securitycenter - - securitycenter-settings - - service-control - - service-management - - service-usage - - servicedirectory - - shell - - spanner - - spanner-jdbc - - speech - - storage - - storage-nio - - storage-transfer - - talent - - tasks - - texttospeech - - tpu - - trace - - translate - - video-intelligence - - video-transcoder - - vision - - vpcaccess - - webrisk - - websecurityscanner - - workflow-executions - - workflows + - accessapproval + - accesscontextmanager + - aiplatform + - analytics-admin + - analytics-data + - api-gateway + - apigee-connect + - appengine-admin + - area120-tables + - artifact-registry + - asset + - assured-workloads + - automl + - bigquery + - bigqueryconnection + - bigquerydatatransfer + - bigquerymigration + - bigqueryreservation + - bigtable + - billing + - billingbudgets + - binary-authorization + - channel + - cloudbuild + - compute + - contact-center-insights + - container + - containeranalysis + - data-fusion + - datacatalog + - dataflow + - datalabeling + - dataproc + - dataproc-metastore + - datastore + - datastream + - debugger-client + - deploy + - dialogflow + - dialogflow-cx + - dlp + - dms + - dns + - document-ai + - domains + - errorreporting + - essential-contacts + - eventarc + - filestore + - firestore + - functions + - game-servers + - gke-connect-gateway + - gkehub + - gsuite-addons + - iam-admin + - iamcredentials + - iot + - kms + - language + - life-sciences + - logging + - logging-logback + - managed-identities + - mediatranslation + - memcache + - monitoring + - monitoring-dashboards + - network-management + - network-security + - networkconnectivity + - notebooks + - orchestration-airflow + - orgpolicy + - os-config + - os-login + - phishingprotection + - policy-troubleshooter + - private-catalog + - profiler + - pubsublite + - recaptchaenterprise + - recommendations-ai + - recommender + - redis + - resource-settings + - resourcemanager + - retail + - scheduler + - secretmanager + - security-private-ca + - securitycenter + - securitycenter-settings + - service-control + - service-management + - service-usage + - servicedirectory + - shell + - spanner + - spanner-jdbc + - speech + - storage + - storage-nio + - storage-transfer + - talent + - tasks + - texttospeech + - tpu + - trace + - translate + - video-intelligence + - video-transcoder + - vision + - vpcaccess + - webrisk + - websecurityscanner + - workflow-executions + - workflows steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - distribution: zulu - java-version: ${{matrix.java}} - - run: java -version - - run: sudo apt-get update -y - - run: sudo apt-get install libxml2-utils - - run: .kokoro/downstream-client-library-check.sh google-http-client-bom ${{matrix.repo}} + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: zulu + java-version: ${{matrix.java}} + - run: java -version + - run: sudo apt-get update -y + - run: sudo apt-get install libxml2-utils + - run: >- + .kokoro/downstream-client-library-check.sh google-http-client-bom + ${{matrix.repo}}