Skip to content

Commit

Permalink
Add actions for maven builds
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp94831 committed Sep 19, 2023
1 parent c7f5f5c commit e645b34
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions actions/java-maven-build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -20,4 +21,5 @@ steps:
java-distribution: "microsoft" # (Optional)
java-version: "11" # (Optional)
working-directory: "." # (Optional)
command: "compile" # (Optional)
```
6 changes: 5 additions & 1 deletion actions/java-maven-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
3 changes: 2 additions & 1 deletion actions/java-maven-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -22,4 +22,5 @@ steps:
java-distribution: "microsoft" # (Optional)
java-version: "11" # (Optional)
working-directory: "." # (Optional)
command: "test" # (Optional)
```
4 changes: 2 additions & 2 deletions actions/java-maven-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 }}

0 comments on commit e645b34

Please sign in to comment.