From 6d380d4f9fb7634adb71599c1e514e17c30a8064 Mon Sep 17 00:00:00 2001 From: Laurent SCHOELENS <61973605+laurentschoelens@users.noreply.github.com> Date: Wed, 11 Jun 2025 09:31:12 +0200 Subject: [PATCH] =?UTF-8?q?[#611]=C2=A0add=20actions=20for=20mvn=204=20bui?= =?UTF-8?q?ld=20+=20use=20matrix=20strategy=20to=20simplify=20java=20versi?= =?UTF-8?q?ons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/maven-build-action.yaml | 68 ++++++++++------------- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/.github/workflows/maven-build-action.yaml b/.github/workflows/maven-build-action.yaml index fad36c23f..45eac1946 100644 --- a/.github/workflows/maven-build-action.yaml +++ b/.github/workflows/maven-build-action.yaml @@ -8,53 +8,45 @@ on: jobs: build_and_test: - runs-on: ubuntu-latest - + strategy: + matrix: + java: [ '11', '17', '21' ] steps: - - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + - name: Setup JDK ${{ matrix.java }} + uses: actions/setup-java@v4 with: - java-version: 11 + java-version: ${{ matrix.java }} distribution: 'temurin' - - - name: Maven with JDK 11 + - name: Maven with JDK ${{ matrix.java }} run: mvn -Pall -no-transfer-progress clean install - - - name: Maven with JDK 11 - Parallel + - name: Maven with JDK ${{ matrix.java }} - Parallel run: mvn -T4 -Pall -no-transfer-progress clean install - - - name: Maven with JDK 11 - Release dry run + - name: Maven with JDK ${{ matrix.java }} - Release dry run run: mvn -Prelease-dry-run,sonatype-oss-release,release -DperformRelease -DdryRun=true -Darguments="-Dgpg.skip=true" -B release:clean release:prepare clean install - - name: Set up JDK 17 - uses: actions/setup-java@v3 + build_and_test_mvn4: + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '17', '21' ] + steps: + - uses: actions/checkout@v4 + - name: Setup Maven4 + run: | + MAVEN_VERSION=4.0.0-rc-3 + wget https://archive.apache.org/dist/maven/maven-4/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz + tar xzvf apache-maven-$MAVEN_VERSION-bin.tar.gz + sudo mv apache-maven-$MAVEN_VERSION /opt/maven + sudo rm -f /usr/bin/mvn # Remove existing symbolic link if it exists + sudo ln -s /opt/maven/bin/mvn /usr/bin/mvn # Create new symbolic link + - name: Setup JDK ${{ matrix.java }} + uses: actions/setup-java@v4 with: - java-version: 17 + java-version: ${{ matrix.java }} distribution: 'temurin' - - - name: Maven with JDK 17 + - name: Maven4 with JDK ${{ matrix.java }} run: mvn -Pall -no-transfer-progress clean install - - - name: Maven with JDK 17 - Parallel + - name: Maven4 with JDK ${{ matrix.java }} - Parallel run: mvn -T4 -Pall -no-transfer-progress clean install - - - name: Maven with JDK 17 - Release dry run - run: mvn -Prelease-dry-run,sonatype-oss-release,release -DperformRelease -DdryRun=true -Darguments="-Dgpg.skip=true" -B release:clean release:prepare clean install - - - name: Set up JDK 21 - uses: actions/setup-java@v3 - with: - java-version: 21-ea - distribution: 'temurin' - - - name: Maven with JDK 21 - run: mvn -Pall -no-transfer-progress clean install - - - name: Maven with JDK 21 - Parallel - run: mvn -T4 -Pall -no-transfer-progress clean install - - - name: Maven with JDK 21 - Release dry run - run: mvn -Prelease-dry-run,sonatype-oss-release,release -DperformRelease -DdryRun=true -Darguments="-Dgpg.skip=true" -B release:clean release:prepare clean install -