Skip to content

Commit

Permalink
Refine CI build plan
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kriegaex committed Feb 10, 2024
1 parent e7ad04d commit 602216e
Showing 1 changed file with 93 additions and 1 deletion.
94 changes: 93 additions & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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

0 comments on commit 602216e

Please sign in to comment.