2022-01-20 13:05:17 +00:00
|
|
|
name: Maven Build Artifact
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
2022-01-27 13:58:42 +00:00
|
|
|
inputs:
|
|
|
|
java-version:
|
|
|
|
description: 'Java version'
|
|
|
|
required: false
|
2024-07-17 15:38:19 +00:00
|
|
|
default: "21"
|
2022-01-27 13:58:42 +00:00
|
|
|
type: string
|
|
|
|
java-distribution:
|
|
|
|
description: 'Java distribution'
|
|
|
|
required: false
|
2023-01-19 13:27:59 +00:00
|
|
|
default: "temurin"
|
2022-01-27 13:58:42 +00:00
|
|
|
type: string
|
2022-11-15 16:04:54 +00:00
|
|
|
mvn-options:
|
|
|
|
description: 'Additional maven options'
|
|
|
|
required: false
|
|
|
|
default: ""
|
|
|
|
type: string
|
|
|
|
mvn-args:
|
|
|
|
description: 'Additional maven args'
|
|
|
|
required: false
|
|
|
|
default: ""
|
|
|
|
type: string
|
2022-01-20 13:05:17 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
2022-01-24 10:01:12 +00:00
|
|
|
- name: Checkout Repo
|
2022-05-30 08:21:01 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-01-24 10:01:12 +00:00
|
|
|
|
2022-01-27 13:58:42 +00:00
|
|
|
- name: Set up JDK
|
2022-05-30 08:21:01 +00:00
|
|
|
uses: actions/setup-java@v3
|
2022-01-20 13:05:17 +00:00
|
|
|
with:
|
2022-01-27 13:58:42 +00:00
|
|
|
java-version: ${{ inputs.java-version }}
|
|
|
|
distribution: ${{ inputs.java-distribution }}
|
|
|
|
cache: 'maven'
|
2022-01-24 10:01:12 +00:00
|
|
|
|
2022-01-27 13:58:42 +00:00
|
|
|
- name: Maven Compile
|
2022-11-15 16:04:54 +00:00
|
|
|
run: |
|
|
|
|
mvn \
|
|
|
|
--no-transfer-progress \
|
|
|
|
--batch-mode ${{ inputs.mvn-options }} \
|
2023-07-03 06:31:35 +00:00
|
|
|
clean compile ${{ inputs.mvn-args }}
|
2022-01-24 10:01:12 +00:00
|
|
|
|
2022-01-27 13:58:42 +00:00
|
|
|
test-coverage:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: Checkout Repo
|
2022-05-30 08:21:01 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-01-27 13:58:42 +00:00
|
|
|
|
|
|
|
- name: Set up JDK
|
2022-05-30 08:21:01 +00:00
|
|
|
uses: actions/setup-java@v3
|
2022-01-27 13:58:42 +00:00
|
|
|
with:
|
|
|
|
java-version: ${{ inputs.java-version }}
|
|
|
|
distribution: ${{ inputs.java-distribution }}
|
|
|
|
cache: 'maven'
|
|
|
|
|
|
|
|
- name: Maven Verify
|
2022-11-15 16:04:54 +00:00
|
|
|
run: |
|
|
|
|
mvn \
|
|
|
|
--no-transfer-progress \
|
|
|
|
--batch-mode ${{ inputs.mvn-options }} \
|
|
|
|
clean verify ${{ inputs.mvn-args }}
|
2022-01-27 13:58:42 +00:00
|
|
|
|
2022-01-24 09:16:48 +00:00
|
|
|
- name: Upload code coverage
|
2022-05-30 08:21:01 +00:00
|
|
|
uses: codecov/codecov-action@v3
|
2023-06-28 21:55:49 +00:00
|
|
|
|