Files
github-api/.github/workflows/maven-build.yml
Liam Newman 6167d196d9 Remove enable-ci from build-only job
`enable-ci` doesn't make sense with `skipTests`.  
The point of this job is get quick results.
2021-04-05 10:13:14 -07:00

93 lines
3.0 KiB
YAML

name: CI
on: [push, pull_request]
# this is required by spotless for JDK 16+
env:
JAVA_11_PLUS_MAVEN_OPTS: "--add-opens jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-opens jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED"
jobs:
build:
name: build-only (Java ${{ matrix.java }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: [ 16 ]
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Cached .m2
uses: actions/cache@v2.1.4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Maven Install (skipTests)
env:
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
run: mvn -B install -DskipTests --file pom.xml
site:
name: site (Java ${{ matrix.java }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: [ 8, 11 ]
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- uses: actions/cache@v2.1.4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Maven Site
run: mvn -B site -D enable-ci --file pom.xml
test:
name: test (${{ matrix.os }}, Java ${{ matrix.java }})
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [ ubuntu, windows ]
java: [ 8, 11, 16 ]
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- uses: actions/cache@v2.1.4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# JDK 8
- name: Maven Install without Code Coverage
if: matrix.os == 'windows' && matrix.java == '8'
run: mvn -B install --file pom.xml
- name: Maven Install with Code Coverage
if: matrix.os != 'windows' && matrix.java == '8'
run: mvn -B install -D enable-ci --file pom.xml
# JDK 11+
- name: Maven Install without Code Coverage
if: matrix.os == 'windows' && matrix.java != '8'
env:
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
run: mvn -B install --file pom.xml
- name: Maven Install with Code Coverage
if: matrix.os != 'windows' && matrix.java != '8'
env:
MAVEN_OPTS: ${{ env.JAVA_11_PLUS_MAVEN_OPTS }}
run: mvn -B install -D enable-ci --file pom.xml