1# Copyright 2020 Google Inc. All Rights Reserved. 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 15name: CI 16 17on: 18 push: 19 branches: 20 - main 21 pull_request: 22 branches: 23 - main 24 25jobs: 26 test: 27 name: "JDK ${{ matrix.java }} on ${{ matrix.os }}" 28 strategy: 29 fail-fast: false 30 matrix: 31 os: [ ubuntu-latest ] 32 java: [ 21, 17 ] 33 experimental: [ false ] 34 include: 35 # Only test on macos and windows with a single recent JDK to avoid a 36 # combinatorial explosion of test configurations. 37 - os: macos-latest 38 java: 21 39 experimental: false 40 - os: windows-latest 41 java: 21 42 experimental: false 43 - os: ubuntu-latest 44 java: EA 45 experimental: true 46 runs-on: ${{ matrix.os }} 47 continue-on-error: ${{ matrix.experimental }} 48 steps: 49 - name: Cancel previous 50 uses: styfle/cancel-workflow-action@0.9.1 51 with: 52 access_token: ${{ github.token }} 53 - name: 'Check out repository' 54 uses: actions/checkout@v2 55 - name: 'Set up JDK ${{ matrix.java }} from jdk.java.net' 56 if: ${{ matrix.java == 'EA' }} 57 uses: oracle-actions/setup-java@v1 58 with: 59 website: jdk.java.net 60 release: ${{ matrix.java }} 61 cache: 'maven' 62 - name: 'Set up JDK ${{ matrix.java }}' 63 if: ${{ matrix.java != 'EA' }} 64 uses: actions/setup-java@v2 65 with: 66 java-version: ${{ matrix.java }} 67 distribution: 'zulu' 68 cache: 'maven' 69 - name: 'Install' 70 shell: bash 71 run: mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V 72 - name: 'Test' 73 shell: bash 74 run: mvn test -B 75 - name: 'Javadoc' 76 shell: bash 77 run: mvn javadoc:aggregate 78