blob: 5647d1065505bb3b02b3743c09df09381e38f4f8 [file] [log] [blame]
name: Maven
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Maven caching
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Setup JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
java-package: jdk
architecture: x64
- name: Setup JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
java-package: jdk
architecture: x64
- name: Inspect environment (Linux)
if: runner.os == 'Linux'
run: env | grep '^JAVA'
- name: Build with Maven (Linux)
if: runner.os == 'Linux'
run: ./mvnw -V -B -e -DtrimStackTrace=false -Dmaven.test.failure.ignore=true -Dsurefire.rerunFailingTestsCount=1 --global-toolchains .github/workflows/maven-toolchains.xml verify
- name: Publish Test Results (Linux)
if: runner.os == 'Linux'
uses: scacap/action-surefire-report@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
check_name: 'Test Report (Linux)'
report_paths: '**/*-reports/TEST-*.xml'
- name: Inspect environment (Windows)
if: runner.os == 'Windows'
run: set java
- name: Build with Maven (Windows)
if: runner.os == 'Windows'
run: ./mvnw -V -B -e -DtrimStackTrace=false "-Dmaven.test.failure.ignore=true" "-Dsurefire.rerunFailingTestsCount=1" --global-toolchains ".github\workflows\maven-toolchains.xml" verify
- name: Publish Test Results (Windows)
if: runner.os == 'Windows'
uses: scacap/action-surefire-report@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
check_name: 'Test Report (Windows)'
report_paths: '**/*-reports/TEST-*.xml'
- name: Inspect environment (MacOS)
if: runner.os == 'macOS'
run: env | grep '^JAVA'
- name: Build with Maven (MacOS)
if: runner.os == 'macOS'
run: ./mvnw -V -B -e -DtrimStackTrace=false -Dmaven.test.failure.ignore=true -Dsurefire.rerunFailingTestsCount=1 --global-toolchains .github/workflows/maven-toolchains.xml verify
- name: Publish Test Results (MacOS)
if: runner.os == 'macOS'
uses: scacap/action-surefire-report@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
check_name: 'Test Report (MacOS)'
report_paths: '**/*-reports/TEST-*.xml'