-
Notifications
You must be signed in to change notification settings - Fork 6
60 lines (56 loc) Β· 2.21 KB
/
build-java.yaml
File metadata and controls
60 lines (56 loc) Β· 2.21 KB
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
name: Build - java
# Build Java part of our project as a GitHub action
# see https://help.github.com/en/actions/language-and-framework-guides/building-and-testing-java-with-maven
on:
workflow_call:
inputs:
java-version:
required: false
type: string
description: Java version to use # see https://github.com/actions/setup-java#supported-version-syntax
default: 17
java-distribution:
required: false
type: string
description: java distribution to use # see https://github.com/actions/setup-java#supported-distributions
default: corretto
maven-version:
required: false
type: string
description: maven version to use # see https://github.com/s4u/setup-maven-action#supported-version-syntax
default: '3.9.10' # 3.9.10+ is required for Java 24; in theory, we support earlier shoudl we test?
jobs:
ci_java:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: ${{ inputs.java-version }}
# https://github.com/actions/setup-java#supported-distributions
distribution: ${{ inputs.java-distribution }}
- name: Setup Maven Action
uses: s4u/setup-maven-action@v1.18.0
with:
java-version: ${{ inputs.java-version }}
maven-version: ${{ inputs.maven-version }}
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-v1-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-v1-
- name: Clear our artifacts from Maven cache # q: does this work!?!?!
run: |
rm -rf ~/.m2/repository/co/worklytics/
rm -rf ~/.m2/repository/com/avaulta/
- name: Compile
working-directory: java/
run: |
mvn clean compile -T 2C -Dversions.logOutput=false
- name: Test
working-directory: java/
run: |
mvn post-clean test -T 2C -Dversions.logOutput=false -DprocessDependencies=false -DprocessDependencyManagement=false -Dsurefire.forkCount=2.5C -Dsurefire.reuseForks=true