(Re)set minimal Java version to (again) be 8 instead of 11 (fixes #142) #455
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
name: Java CI with Maven | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# Nota Bene: Even though the project (currently) targets Java 8 API level, | |
# we cannot build it under Java 8 anymore, because Error Prone (which we use) | |
# must be run on JDK 11 or newer (but we can and are still using | |
# source/target/release 8 instead 11 in the pom.xml). | |
java: [ '11', '17', '21' ] | |
name: Java ${{ matrix.Java }} CI | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set JDK ${{ matrix.Java }} | |
uses: actions/setup-java@v4 | |
with: | |
# Keep this version aligned with pom.xml! | |
java-version: ${{ matrix.java }} | |
distribution: "temurin" #eclipse distribution | |
cache: maven | |
- name: Cache Maven packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ matrix.Java }}-${{ hashFiles('pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-m2-${{ matrix.Java }} | |
${{ runner.os }}-m2 | |
- name: Build with Maven | |
run: mvn --batch-mode --update-snapshots package --file pom.xml | |
- run: mkdir staging && cp target/*.jar staging | |
- uses: actions/upload-artifact@v4 #provide nice artifact | |
with: | |
name: Package-${{ matrix.java }} | |
path: staging |