|
| 1 | +# Copyright 2022 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | +# Github action job to test core java library features on |
| 15 | +# downstream client libraries before they are released. |
| 16 | +on: |
| 17 | + push: |
| 18 | + branches: |
| 19 | + - main |
| 20 | + pull_request: |
| 21 | +name: ci-java7 |
| 22 | +jobs: |
| 23 | + units: |
| 24 | + name: "units (7)" |
| 25 | + runs-on: ubuntu-latest |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v3 |
| 28 | + - uses: actions/setup-java@v1 |
| 29 | + # setup-java v2 or higher does not have version 1.7 |
| 30 | + with: |
| 31 | + version: 1.7 |
| 32 | + architecture: x64 |
| 33 | + - run: | |
| 34 | + java -version |
| 35 | + # This value is used in "-Djvm=" later |
| 36 | + echo "JAVA7_HOME=${JAVA_HOME}" >> $GITHUB_ENV |
| 37 | + - uses: actions/setup-java@v3 |
| 38 | + with: |
| 39 | + java-version: 17 |
| 40 | + distribution: temurin |
| 41 | + - name: Set up Maven |
| 42 | + uses: stCarolas/setup-maven@v4.5 |
| 43 | + with: |
| 44 | + maven-version: 3.8.8 |
| 45 | + - name: Build |
| 46 | + shell: bash |
| 47 | + run: | |
| 48 | + # Leveraging surefire's jvm option, running the test on Java 7. |
| 49 | + # Surefire plugin 2.22.2 is the last version for Java 7. Newer version would fail with |
| 50 | + # "UnsupportedClassVersionError: org/apache/maven/surefire/booter/ForkedBooter" error. |
| 51 | + mvn --batch-mode --show-version -ntp test \ |
| 52 | + -Dclirr.skip=true -Denforcer.skip=true -Dmaven.javadoc.skip=true \ |
| 53 | + -Dgcloud.download.skip=true -T 1C \ |
| 54 | + -Dproject.surefire.version=2.22.2 \ |
| 55 | + -Djvm=${JAVA7_HOME}/bin/java |
0 commit comments