mirror of
https://github.com/valitydev/java-workflow.git
synced 2024-11-06 01:25:18 +00:00
71 lines
1.7 KiB
YAML
71 lines
1.7 KiB
YAML
name: Maven Build Artifact
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
java-version:
|
|
description: 'Java version'
|
|
required: false
|
|
default: "21"
|
|
type: string
|
|
java-distribution:
|
|
description: 'Java distribution'
|
|
required: false
|
|
default: "temurin"
|
|
type: string
|
|
mvn-options:
|
|
description: 'Additional maven options'
|
|
required: false
|
|
default: ""
|
|
type: string
|
|
mvn-args:
|
|
description: 'Additional maven args'
|
|
required: false
|
|
default: ""
|
|
type: string
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up JDK
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
java-version: ${{ inputs.java-version }}
|
|
distribution: ${{ inputs.java-distribution }}
|
|
cache: 'maven'
|
|
|
|
- name: Maven Compile
|
|
run: |
|
|
mvn \
|
|
--no-transfer-progress \
|
|
--batch-mode ${{ inputs.mvn-options }} \
|
|
clean compile ${{ inputs.mvn-args }}
|
|
|
|
test-coverage:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up JDK
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
java-version: ${{ inputs.java-version }}
|
|
distribution: ${{ inputs.java-distribution }}
|
|
cache: 'maven'
|
|
|
|
- name: Maven Verify
|
|
run: |
|
|
mvn \
|
|
--no-transfer-progress \
|
|
--batch-mode ${{ inputs.mvn-options }} \
|
|
clean verify ${{ inputs.mvn-args }}
|
|
|
|
- name: Upload code coverage
|
|
uses: codecov/codecov-action@v3
|
|
|