blob: 87582f02b664f615a1d2b29dac76397d147c59d6 [file] [log] [blame]
Liam Miller-Cushon88b8edf2020-12-08 09:12:51 -08001# 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
Liam Miller-Cushon5db787b2021-03-12 14:21:14 -080017on:
18 push:
19 branches:
Liam Miller-Cushon09beae42021-05-21 12:45:19 -070020 - main
Liam Miller-Cushon5db787b2021-03-12 14:21:14 -080021 pull_request:
22 branches:
Liam Miller-Cushon09beae42021-05-21 12:45:19 -070023 - main
Liam Miller-Cushon88b8edf2020-12-08 09:12:51 -080024
25jobs:
26 test:
27 name: "JDK ${{ matrix.java }} on ${{ matrix.os }}"
28 strategy:
29 fail-fast: false
30 matrix:
Liam Miller-Cushon01e6e1d2020-12-28 19:51:34 -080031 os: [ ubuntu-latest ]
Liam Miller-Cushon20f90c82021-05-13 16:03:05 -070032 java: [ 16, 11, 8 ]
Liam Miller-Cushon01e6e1d2020-12-28 19:51:34 -080033 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-Cushon20f90c82021-05-13 16:03:05 -070038 java: 16
Liam Miller-Cushon01e6e1d2020-12-28 19:51:34 -080039 experimental: false
40 - os: windows-latest
Liam Miller-Cushon20f90c82021-05-13 16:03:05 -070041 java: 16
Liam Miller-Cushon01e6e1d2020-12-28 19:51:34 -080042 experimental: false
43 - os: ubuntu-latest
Liam Miller-Cushon20f90c82021-05-13 16:03:05 -070044 java: 17-ea
Liam Miller-Cushon01e6e1d2020-12-28 19:51:34 -080045 experimental: true
Liam Miller-Cushon88b8edf2020-12-08 09:12:51 -080046 runs-on: ${{ matrix.os }}
Liam Miller-Cushon01e6e1d2020-12-28 19:51:34 -080047 continue-on-error: ${{ matrix.experimental }}
Liam Miller-Cushon88b8edf2020-12-08 09:12:51 -080048 steps:
Liam Miller-Cushon5db787b2021-03-12 14:21:14 -080049 - name: Cancel previous
50 uses: styfle/cancel-workflow-action@0.8.0
51 with:
52 access_token: ${{ github.token }}
Liam Miller-Cushon88b8edf2020-12-08 09:12:51 -080053 - 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-Cushon44dae622021-07-14 11:52:04 -070063 uses: actions/setup-java@v2
Liam Miller-Cushon88b8edf2020-12-08 09:12:51 -080064 with:
65 java-version: ${{ matrix.java }}
Liam Miller-Cushon44dae622021-07-14 11:52:04 -070066 distribution: 'adopt'
Liam Miller-Cushon88b8edf2020-12-08 09:12:51 -080067 - 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-Cushonf4d084a2021-06-15 19:16:54 -070073 - name: 'Javadoc'
74 shell: bash
75 run: mvn javadoc:aggregate