From 1294e6207e1e9248a7595af68be180fb7c618117 Mon Sep 17 00:00:00 2001 From: sebthom Date: Fri, 6 Sep 2024 22:31:14 +0200 Subject: [PATCH] ci: improve github workflow This commit: 1. disables excessive Maven transfer logging to the console, 2. enables caching when running workflows with nektos/act, and 3. implements a more reliable way to populate JAVA17_HOME and JAVA21_HOME Signed-off-by: sebthom --- .github/workflows/build.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4f81db110..99fa26400 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,19 +70,25 @@ jobs: - name: "Install: JDK 17 ☕" + id: setup-java-17 uses: actions/setup-java@v4 # https://github.com/actions/setup-java with: distribution: temurin java-version: 17 - - run: echo "JAVA17_HOME=$JAVA_HOME" >> $GITHUB_ENV - name: "Install: JDK 21 ☕" + id: setup-java-21 uses: actions/setup-java@v4 # https://github.com/actions/setup-java with: distribution: temurin java-version: 21 - - run: echo "JAVA21_HOME=$JAVA_HOME" >> $GITHUB_ENV + + + - name: Set JAVA_HOME env vars + run: | + echo "JAVA17_HOME=${{ steps.setup-java-17.outputs.path }}" >> $GITHUB_ENV + echo "JAVA21_HOME=${{ steps.setup-java-21.outputs.path }}" >> $GITHUB_ENV - name: "Show: toolchains.xml" @@ -91,7 +97,6 @@ jobs: - name: "Cache: Local Maven Repository" uses: actions/cache@v4 - if: ${{ !env.ACT }} # https://github.com/nektos/act#skipping-steps with: # Excluded sub directory not working https://github.com/actions/toolkit/issues/713 path: | @@ -99,6 +104,7 @@ jobs: !~/.m2/repository/*SNAPSHOT* key: ${{ runner.os }}-mvn-${{ hashFiles('**/pom.xml') }} + - name: Prepare Maven Snapshots Repo if: ${{ github.ref_name == 'main' && !env.ACT }} # https://github.com/nektos/act#skipping-steps run: | @@ -150,7 +156,7 @@ jobs: ./mvnw \ --errors \ - --update-snapshots \ + --no-transfer-progress \ --batch-mode \ --show-version \ ${{ github.event.inputs.additional_maven_args }} \