Liam Miller-Cushon | 88b8edf | 2020-12-08 09:12:51 -0800 | [diff] [blame] | 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 | |
| 15 | name: CI |
| 16 | |
Liam Miller-Cushon | 5db787b | 2021-03-12 14:21:14 -0800 | [diff] [blame] | 17 | on: |
| 18 | push: |
| 19 | branches: |
Liam Miller-Cushon | 09beae4 | 2021-05-21 12:45:19 -0700 | [diff] [blame] | 20 | - main |
Liam Miller-Cushon | 5db787b | 2021-03-12 14:21:14 -0800 | [diff] [blame] | 21 | pull_request: |
| 22 | branches: |
Liam Miller-Cushon | 09beae4 | 2021-05-21 12:45:19 -0700 | [diff] [blame] | 23 | - main |
Liam Miller-Cushon | 88b8edf | 2020-12-08 09:12:51 -0800 | [diff] [blame] | 24 | |
| 25 | jobs: |
| 26 | test: |
| 27 | name: "JDK ${{ matrix.java }} on ${{ matrix.os }}" |
| 28 | strategy: |
| 29 | fail-fast: false |
| 30 | matrix: |
Liam Miller-Cushon | 01e6e1d | 2020-12-28 19:51:34 -0800 | [diff] [blame] | 31 | os: [ ubuntu-latest ] |
Liam Miller-Cushon | 20f90c8 | 2021-05-13 16:03:05 -0700 | [diff] [blame] | 32 | java: [ 16, 11, 8 ] |
Liam Miller-Cushon | 01e6e1d | 2020-12-28 19:51:34 -0800 | [diff] [blame] | 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 |
Liam Miller-Cushon | 20f90c8 | 2021-05-13 16:03:05 -0700 | [diff] [blame] | 38 | java: 16 |
Liam Miller-Cushon | 01e6e1d | 2020-12-28 19:51:34 -0800 | [diff] [blame] | 39 | experimental: false |
| 40 | - os: windows-latest |
Liam Miller-Cushon | 20f90c8 | 2021-05-13 16:03:05 -0700 | [diff] [blame] | 41 | java: 16 |
Liam Miller-Cushon | 01e6e1d | 2020-12-28 19:51:34 -0800 | [diff] [blame] | 42 | experimental: false |
| 43 | - os: ubuntu-latest |
Liam Miller-Cushon | 20f90c8 | 2021-05-13 16:03:05 -0700 | [diff] [blame] | 44 | java: 17-ea |
Liam Miller-Cushon | 01e6e1d | 2020-12-28 19:51:34 -0800 | [diff] [blame] | 45 | experimental: true |
Liam Miller-Cushon | 88b8edf | 2020-12-08 09:12:51 -0800 | [diff] [blame] | 46 | runs-on: ${{ matrix.os }} |
Liam Miller-Cushon | 01e6e1d | 2020-12-28 19:51:34 -0800 | [diff] [blame] | 47 | continue-on-error: ${{ matrix.experimental }} |
Liam Miller-Cushon | 88b8edf | 2020-12-08 09:12:51 -0800 | [diff] [blame] | 48 | steps: |
Liam Miller-Cushon | 5db787b | 2021-03-12 14:21:14 -0800 | [diff] [blame] | 49 | - name: Cancel previous |
| 50 | uses: styfle/cancel-workflow-action@0.8.0 |
| 51 | with: |
| 52 | access_token: ${{ github.token }} |
Liam Miller-Cushon | 88b8edf | 2020-12-08 09:12:51 -0800 | [diff] [blame] | 53 | - name: 'Check out repository' |
| 54 | uses: actions/checkout@v2 |
| 55 | - name: 'Cache local Maven repository' |
| 56 | uses: actions/cache@v2 |
| 57 | with: |
| 58 | path: ~/.m2/repository |
| 59 | key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} |
| 60 | restore-keys: | |
| 61 | ${{ runner.os }}-maven- |
| 62 | - name: 'Set up JDK ${{ matrix.java }}' |
Liam Miller-Cushon | 44dae62 | 2021-07-14 11:52:04 -0700 | [diff] [blame^] | 63 | uses: actions/setup-java@v2 |
Liam Miller-Cushon | 88b8edf | 2020-12-08 09:12:51 -0800 | [diff] [blame] | 64 | with: |
| 65 | java-version: ${{ matrix.java }} |
Liam Miller-Cushon | 44dae62 | 2021-07-14 11:52:04 -0700 | [diff] [blame^] | 66 | distribution: 'adopt' |
Liam Miller-Cushon | 88b8edf | 2020-12-08 09:12:51 -0800 | [diff] [blame] | 67 | - name: 'Install' |
| 68 | shell: bash |
| 69 | run: mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V |
| 70 | - name: 'Test' |
| 71 | shell: bash |
| 72 | run: mvn test -B |
Liam Miller-Cushon | f4d084a | 2021-06-15 19:16:54 -0700 | [diff] [blame] | 73 | - name: 'Javadoc' |
| 74 | shell: bash |
| 75 | run: mvn javadoc:aggregate |