| name: Maven |
| |
| on: [push] |
| |
| jobs: |
| build: |
| |
| runs-on: ${{ matrix.os }} |
| |
| strategy: |
| matrix: |
| os: [ubuntu-latest, windows-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 verify --global-toolchains .github/workflows/maven-toolchains.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 verify --global-toolchains ".github\workflows\maven-toolchains.xml" |