Skip to content

Commit

Permalink
add inputs to control new feature
Browse files Browse the repository at this point in the history
  • Loading branch information
gionn committed Oct 31, 2023
1 parent 5bd70d8 commit ae18d43
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/actions/setup-java-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ inputs:
description: the location of the custom Maven settings.xml file to install
default: ".ci.settings.xml"
required: false
maven-version:
description: "Install a custom maven version via sdkman"
required: false
build-cache:
description: Enable the maven build cache extension
default: "false"
required: false
runs:
using: composite
steps:
Expand All @@ -37,13 +44,15 @@ runs:
fi
- name: Enable maven build cache
if: inputs.build-cache != 'false'
shell: bash
run: |
mkdir -p .mvn
cp ${{ github.action_path }}/extensions.xml .mvn/extensions.xml
cp ${{ github.action_path }}/maven-build-cache-config.xml .mvn/maven-build-cache-config.xml
- name: "Build cache"
if: inputs.build-cache != 'false'
uses: actions/cache@v3
with:
path: ~/.m2/build-cache
Expand All @@ -53,15 +62,12 @@ runs:
${{ runner.os }}-buildcache-${{ hashFiles('.mvn/*.xml') }}-
${{ runner.os }}-buildcache-
- name: Install latest mvnd
uses: sdkman/sdkman-action@b1f9b696c79148b66d3d3a06f7ea801820318d0f
with:
candidate: mvnd

- name: Install latest maven
- name: Install maven ${{ inputs.maven-version || '(latest)'}}
if: inputs.build-cache != 'false' || inputs.maven-version != ''
uses: sdkman/sdkman-action@b1f9b696c79148b66d3d3a06f7ea801820318d0f
with:
candidate: maven
version: ${{ inputs.maven-version }}

- name: "Set up Java"
uses: actions/setup-java@v3
Expand Down

0 comments on commit ae18d43

Please sign in to comment.