Update CI to work with Java 17+ and use the maven.compliler.release property #1640
Workflow file for this run
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 | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven | |
name: Undertow CI | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
workflow_dispatch: | |
# Only run the latest job | |
concurrency: | |
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
cancel-in-progress: true | |
jobs: | |
build-all: | |
name: Compile (no tests) with JDK 11 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 11 | |
cache: 'maven' | |
- name: Build | |
run: mvn -V -U -B -fae -DskipTests -Dfindbugs clean install | |
- name: Tar Maven Repo | |
shell: bash | |
run: tar -czf maven-repo.tgz -C ~ .m2/repository | |
- name: Persist Maven Repo | |
uses: actions/upload-artifact@v4 | |
with: | |
name: maven-repo | |
path: maven-repo.tgz | |
- uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: surefire-reports-build | |
path: | | |
**/surefire*-reports/*.txt | |
**/*.dump* | |
test-matrix: | |
name: JDK ${{ matrix.jdk }} - ${{ matrix.module }} - ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
needs: build-all | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
module: [core] | |
jdk: [11, 17, 21] | |
openjdk_impl: [ temurin ] | |
steps: | |
- name: Update hosts - linux | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
cat /etc/hosts | |
sudo bash -c "echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4' > /etc/hosts" | |
sudo bash -c "echo '::1 localhost localhost.localdomain localhost6 localhost6.localdomain6' >> /etc/hosts" | |
sudo sysctl -w fs.file-max=2097152 | |
- name: Update hosts - windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
type %SystemRoot%\System32\drivers\etc\hosts | |
echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4' > %SystemRoot%\System32\drivers\etc\hosts | |
echo '::1 localhost localhost.localdomain localhost6 localhost6.localdomain6' >> %SystemRoot%\System32\drivers\etc\hosts | |
shell: cmd | |
- name: Host information | |
run: | | |
hostname || true | |
- uses: actions/checkout@v4 | |
- name: Download Maven Repo | |
uses: actions/download-artifact@v4 | |
with: | |
name: maven-repo | |
path: . | |
- name: Extract Maven Repo | |
shell: bash | |
run: tar -xzf maven-repo.tgz -C ~ | |
- name: Set up JDK ${{ matrix.java }} | |
uses: actions/setup-java@v4 | |
with: | |
distribution: ${{ matrix.openjdk_impl }} | |
java-version: ${{ matrix.jdk }} | |
cache: 'maven' | |
- name: Run Tests | |
run: mvn -V -U -B -fae test -Pproxy '-DfailIfNoTests=false' -pl ${{ matrix.module }} '-P-java${{ matrix.jdk }}-test-classpath' | |
- uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: surefire-reports-${{ matrix.jdk }}-${{ matrix.module }}-${{ matrix.os }} | |
path: | | |
**/surefire*-reports/*.txt | |
**/*.dump* | |
test-matrix-ipv6: | |
name: JDK ${{ matrix.jdk }} - ipv6 - ${{ matrix.module }} ${{ matrix.proxy }} - ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
needs: build-all | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
module: [core, servlet, websockets-jsr] | |
proxy: ['-Pproxy', ''] | |
jdk: [11] | |
steps: | |
- name: Update hosts - linux | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo bash -c "echo '127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4' > /etc/hosts" | |
sudo bash -c "echo '::1 localhost localhost.localdomain localhost6 localhost6.localdomain6' >> /etc/hosts" | |
sudo sysctl -w fs.file-max=2097152 | |
- name: Host information | |
run: | | |
hostname || true | |
- uses: actions/checkout@v4 | |
- name: Download Maven Repo | |
uses: actions/download-artifact@v4 | |
with: | |
name: maven-repo | |
path: . | |
- name: Extract Maven Repo | |
shell: bash | |
run: tar -xzf maven-repo.tgz -C ~ | |
- name: Set up JDK ${{ matrix.java }} | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.jdk }} | |
distribution: 'temurin' | |
cache: 'maven' | |
- name: Run Tests | |
run: mvn -V -U -B -fae test ${{ matrix.proxy }} '-DfailIfNoTests=false' -pl ${{ matrix.module }} -Dtest.ipv6=true '-P-java${{ matrix.jdk }}-test-classpath' | |
- uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: surefire-reports-${{ matrix.jdk }}-ipv6-${{ matrix.module }}${{ matrix.proxy }}-${{ matrix.os }} | |
path: | | |
**/surefire*-reports/*.txt | |
**/*.dump* |