-
Notifications
You must be signed in to change notification settings - Fork 3
64 lines (63 loc) · 2.34 KB
/
build-java-service.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
on:
workflow_call:
inputs:
service_name:
required: true
type: string
version:
required: false
type: string
outputs:
jar-artifact-name:
value: ${{ jobs.build.outputs.jar-artifact-name }}
jar-artifact-path:
value: ${{ jobs.build.outputs.jar-artifact-path }}
license-artifact-name:
value: ${{ jobs.build.outputs.license-artifact-name }}
license-artifact-path:
value: ${{ jobs.build.outputs.license-artifact-path }}
jobs:
build:
name: ${{ inputs.service_name }}
runs-on: ubuntu-latest
outputs:
jar-artifact-name: ${{ inputs.service_name }}-jar
jar-artifact-path: ./services/${{ inputs.service_name }}/build/libs/
license-artifact-name: ${{ inputs.service_name }}-license
license-artifact-path: ./services/${{ inputs.service_name }}/build/distributions
steps:
- name: ⬇️ Checkout
uses: actions/checkout@v4
- name: 🛠 Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'zulu'
- name: ✔️ Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: 🏗 Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build -Pversion=${{ inputs.version }} generateLicenseReport
build-root-directory: services/${{ inputs.service_name }}
- name: 📦 Upload JAR
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.service_name }}-jar
path: ./services/${{ inputs.service_name }}/build/libs/${{ inputs.service_name }}-*.jar
- name: 📦 Upload license report
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.service_name }}-license
path: ./services/${{ inputs.service_name }}/build/distributions/license-report.zip
- name: 📦 Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: ./services/${{ inputs.service_name }}/build/test-results/
- name: 🔎 Upload coverage report
uses: codecov/codecov-action@v3
with:
files: ./services/${{ inputs.service_name }}/build/reports/jacoco/test/jacocoTestReport.xml
name: habitcentric/${{ inputs.service_name }}