From e645b34e78a4a290033fcaca837c074e95f657bc Mon Sep 17 00:00:00 2001 From: Philipp Schirmer Date: Tue, 19 Sep 2023 16:24:55 +0200 Subject: [PATCH] Add actions for maven builds --- actions/java-maven-build/README.md | 2 ++ actions/java-maven-build/action.yaml | 6 +++++- actions/java-maven-test/README.md | 3 ++- actions/java-maven-test/action.yaml | 4 ++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/actions/java-maven-build/README.md b/actions/java-maven-build/README.md index 960beb92e..578a23f03 100644 --- a/actions/java-maven-build/README.md +++ b/actions/java-maven-build/README.md @@ -9,6 +9,7 @@ This action builds Java artifacts using Maven. | java-distribution | ❌ | microsoft | string | [Java distribution](https://github.com/actions/setup-java#supported-distributions) to be installed | | java-version | ❌ | 11 | string | Java version to be installed | | working-directory | ❌ | "." | string | Working directory of your Maven artifacts | +| command | ❌ | compile | string | Command to run build with | ## Usage @@ -20,4 +21,5 @@ steps: java-distribution: "microsoft" # (Optional) java-version: "11" # (Optional) working-directory: "." # (Optional) + command: "compile" # (Optional) ``` diff --git a/actions/java-maven-build/action.yaml b/actions/java-maven-build/action.yaml index 7de8e2645..fd77e1bd1 100644 --- a/actions/java-maven-build/action.yaml +++ b/actions/java-maven-build/action.yaml @@ -14,6 +14,10 @@ inputs: description: "Working directory of your Maven artifacts. (Default is .)" required: false default: "." + command: + description: "Command to run build with. (Default is compile)" + required: false + default: "compile" runs: using: "composite" steps: @@ -27,6 +31,6 @@ runs: java-version: ${{ inputs.java-version }} - name: Compile - run: mvn clean compile + run: mvn clean ${{ inputs.command }} shell: bash working-directory: ${{ inputs.working-directory }} diff --git a/actions/java-maven-test/README.md b/actions/java-maven-test/README.md index a0c6aac2e..c39f369f2 100644 --- a/actions/java-maven-test/README.md +++ b/actions/java-maven-test/README.md @@ -10,7 +10,7 @@ This action runs Junit tests. | java-version | ❌ | 11 | string | Java version to be installed | | working-directory | ❌ | "." | string | Working directory of your Maven artifacts | | download-lfs-files | ❌ | false | boolean | Whether the Git checkout action should resolve LFS files or not | -| test-command | ❌ | test | string | Command to run tests with | +| command | ❌ | test | string | Command to run tests with | ## Usage @@ -22,4 +22,5 @@ steps: java-distribution: "microsoft" # (Optional) java-version: "11" # (Optional) working-directory: "." # (Optional) + command: "test" # (Optional) ``` diff --git a/actions/java-maven-test/action.yaml b/actions/java-maven-test/action.yaml index 7c86a7d1d..6f8a7053e 100644 --- a/actions/java-maven-test/action.yaml +++ b/actions/java-maven-test/action.yaml @@ -18,7 +18,7 @@ inputs: description: "Whether the Git checkout action should resolve LFS files or not. (Default is false)" required: false default: false - test-command: + command: description: "Command to run tests with. (Default is test)" required: false default: "test" @@ -39,6 +39,6 @@ runs: java-version: ${{ inputs.java-version }} - name: Run tests - run: mvn ${{ inputs.test-command }} + run: mvn ${{ inputs.command }} shell: bash working-directory: ${{ inputs.working-directory }}