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. 16on: 17 push: 18 branches: 19 - main 20 pull_request: 21name: ci 22jobs: 23 units: 24 runs-on: ubuntu-latest 25 strategy: 26 fail-fast: false 27 matrix: 28 java: [11, 17, 21] 29 steps: 30 - uses: actions/checkout@v3 31 - uses: actions/setup-java@v3 32 with: 33 distribution: temurin 34 java-version: ${{matrix.java}} 35 - run: java -version 36 - run: .kokoro/build.sh 37 env: 38 JOB_TYPE: test 39 units-java8: 40 # Building using Java 17 and run the tests with Java 8 runtime 41 name: "units (8)" 42 runs-on: ubuntu-latest 43 steps: 44 - uses: actions/checkout@v3 45 - uses: actions/setup-java@v3 46 with: 47 java-version: 8 48 distribution: temurin 49 - name: "Set jvm system property environment variable for surefire plugin (unit tests)" 50 # Maven surefire plugin (unit tests) allows us to specify JVM to run the tests. 51 # https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm 52 run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java" >> $GITHUB_ENV 53 shell: bash 54 - uses: actions/setup-java@v3 55 with: 56 java-version: 17 57 distribution: temurin 58 - run: .kokoro/build.sh 59 env: 60 JOB_TYPE: test 61 windows: 62 runs-on: windows-latest 63 steps: 64 - name: Support longpaths 65 run: git config --system core.longpaths true 66 - uses: actions/checkout@v3 67 - uses: actions/setup-java@v3 68 with: 69 distribution: temurin 70 java-version: 8 71 - run: java -version 72 - run: .kokoro/build.bat 73 env: 74 JOB_TYPE: test 75 dependencies: 76 runs-on: ubuntu-latest 77 strategy: 78 matrix: 79 java: [17] 80 steps: 81 - uses: actions/checkout@v3 82 - uses: actions/setup-java@v3 83 with: 84 distribution: temurin 85 java-version: ${{matrix.java}} 86 - run: java -version 87 - run: .kokoro/dependencies.sh 88 javadoc: 89 runs-on: ubuntu-latest 90 steps: 91 - uses: actions/checkout@v3 92 - uses: actions/setup-java@v3 93 with: 94 distribution: temurin 95 java-version: 17 96 - run: java -version 97 - run: .kokoro/build.sh 98 env: 99 JOB_TYPE: javadoc 100 lint: 101 runs-on: ubuntu-latest 102 steps: 103 - uses: actions/checkout@v3 104 - uses: actions/setup-java@v3 105 with: 106 distribution: temurin 107 java-version: 11 108 - run: java -version 109 - run: .kokoro/build.sh 110 env: 111 JOB_TYPE: lint 112 clirr: 113 runs-on: ubuntu-latest 114 steps: 115 - uses: actions/checkout@v3 116 - uses: actions/setup-java@v3 117 with: 118 distribution: temurin 119 java-version: 8 120 - run: java -version 121 - run: .kokoro/build.sh 122 env: 123 JOB_TYPE: clirr 124