From 602216e6f26d9418714e2bb07efbcb3bb14d9091 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Sat, 10 Feb 2024 16:38:21 +0700 Subject: [PATCH] Refine CI build plan We now have - one build on Linux, JDK 11, Temurin, which, if it fails, will stop the whole pipeline, - one build on Linux, JDK 11, Temurin, building a Maven site (but currently not attaching it to the build), - a matrix of 4 JDK * 3 OS * 3 JVM distros, minus some combinations, because 36 builds are just too much. --- .github/workflows/maven.yml | 94 ++++++++++++++++++++++++++++++++++++- 1 file changed, 93 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 0c67cdd..ae8ef02 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -35,17 +35,109 @@ on: - '!gh-pages' jobs: + build: + strategy: + matrix: + os: [ ubuntu-latest ] + javaVersion: [ 11 ] + javaDist: [ temurin ] + + runs-on: ${{ matrix.os }} + + steps: + + - name: Set Git options + # Check out as-is, commit Unix-style line endings + run: git config --global core.autocrlf input + + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up cache for ~./m2/repository + uses: actions/cache@v4 + with: + path: | + ~/.m2/repository + !~/.m2/repository/dev/aspectj/aspectj-maven-plugin + key: maven-${{ matrix.os }}-java-${{ matrix.javaVersion }}-${{ matrix.javaDist }}-${{ hashFiles('**/pom.xml') }} + restore-keys: | + maven-${{ matrix.os }}-java-${{ matrix.javaVersion }}-${{ matrix.javaDist }}- + maven-${{ matrix.os }}-java-${{ matrix.javaVersion }}- + maven-${{ matrix.os }}- + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.javaVersion }} + distribution: ${{ matrix.javaDist }} + + - name: Build with Maven + run: mvn --show-version --errors --batch-mode "-Dinvoker.streamLogsOnFailures=true" clean verify + + site: + needs: build + strategy: + matrix: + os: [ ubuntu-latest ] + javaVersion: [ 11 ] + javaDist: [ temurin ] + + runs-on: ${{ matrix.os }} + + steps: + + - name: Set Git options + # Check out as-is, commit Unix-style line endings + run: git config --global core.autocrlf input + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up cache for ~./m2/repository + uses: actions/cache@v4 + with: + path: | + ~/.m2/repository + !~/.m2/repository/dev/aspectj/aspectj-maven-plugin + key: maven-${{ matrix.os }}-java-${{ matrix.javaVersion }}-${{ matrix.javaDist }}-${{ hashFiles('**/pom.xml') }} + restore-keys: | + maven-${{ matrix.os }}-java-${{ matrix.javaVersion }}-${{ matrix.javaDist }}- + maven-${{ matrix.os }}-java-${{ matrix.javaVersion }}- + maven-${{ matrix.os }}- + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.javaVersion }} + distribution: ${{ matrix.javaDist }} + + - name: Build with Maven + run: mvn --show-version --errors --batch-mode "-Dinvoker.streamLogsOnFailures=true" site + + build-all: + needs: build strategy: matrix: os: [ ubuntu-latest, windows-latest, macOS-latest ] javaVersion: [ 8, 11, 17, 21 ] javaDist: [ temurin, zulu, adopt-openj9 ] exclude: + # We built that already in 'build' + - os: ubuntu-latest + javaVersion: 11 + javaDist: temurin # TODO: Include, as soon as OpenJ9 JDK 21 is released - javaVersion: 21 javaDist: adopt-openj9 + - os: windows-latest + javaDist: zulu + - os: windows-latest + javaDist: adopt-openj9 + - os: macOS-latest + javaDist: zulu + - os: macOS-latest + javaDist: adopt-openj9 fail-fast: false runs-on: ${{ matrix.os }} @@ -78,4 +170,4 @@ jobs: distribution: ${{ matrix.javaDist }} - name: Build with Maven - run: mvn --show-version --errors --batch-mode "-Dinvoker.streamLogsOnFailures=true" clean verify site + run: mvn --show-version --errors --batch-mode "-Dinvoker.streamLogsOnFailures=true" clean verify